001: /*
002: * The Apache Software License, Version 1.1
003: *
004: *
005: * Copyright (c) 2002 The Apache Software Foundation. All rights
006: * reserved.
007: *
008: * Redistribution and use in source and binary forms, with or without
009: * modification, are permitted provided that the following conditions
010: * are met:
011: *
012: * 1. Redistributions of source code must retain the above copyright
013: * notice, this list of conditions and the following disclaimer.
014: *
015: * 2. Redistributions in binary form must reproduce the above copyright
016: * notice, this list of conditions and the following disclaimer in
017: * the documentation and/or other materials provided with the
018: * distribution.
019: *
020: * 3. The end-user documentation included with the redistribution,
021: * if any, must include the following acknowledgment:
022: * "This product includes software developed by the
023: * Apache Software Foundation (http://www.apache.org/)."
024: * Alternately, this acknowledgment may appear in the software itself,
025: * if and wherever such third-party acknowledgments normally appear.
026: *
027: * 4. The names "WSIF" and "Apache Software Foundation" must
028: * not be used to endorse or promote products derived from this
029: * software without prior written permission. For written
030: * permission, please contact apache@apache.org.
031: *
032: * 5. Products derived from this software may not be called "Apache",
033: * nor may "Apache" appear in their name, without prior written
034: * permission of the Apache Software Foundation.
035: *
036: * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
037: * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
038: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
039: * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
040: * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
041: * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
042: * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
043: * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
044: * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
045: * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
046: * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
047: * SUCH DAMAGE.
048: * ====================================================================
049: *
050: * This software consists of voluntary contributions made by many
051: * individuals on behalf of the Apache Software Foundation and was
052: * originally based on software copyright (c) 2001, 2002, International
053: * Business Machines, Inc., http://www.apache.org. For more
054: * information on the Apache Software Foundation, please see
055: * <http://www.apache.org/>.
056: */
057:
058: package org.w3.www._2001.XMLSchema.myeis.myeis;
059:
060: import java.io.*;
061: import org.apache.wsif.providers.jca.WSIFFormatHandler_JCA;
062:
063: public class StringFormatHandler implements WSIFFormatHandler_JCA {
064:
065: private String fieldValue = null;
066:
067: /**
068: * @see JCAFormatHandler#read(InputStream)
069: */
070: public void read(InputStream inputStream) throws IOException {
071:
072: try {
073: ObjectInputStream objectInputStream = new ObjectInputStream(
074: inputStream);
075: this .fieldValue = (String) objectInputStream.readObject();
076: } catch (ClassNotFoundException e) {
077: e.printStackTrace();
078: throw new IOException("class not found !");
079: }
080: }
081:
082: /**
083: * @see JCAFormatHandler#write(OutputStream)
084: */
085: public void write(OutputStream outputStream) throws IOException {
086:
087: ObjectOutputStream objectOutputStream = new ObjectOutputStream(
088: outputStream);
089: objectOutputStream.writeObject(this .fieldValue);
090: objectOutputStream.flush();
091: }
092:
093: /**
094: * @see WSIFFormatHandler#getElement(String)
095: */
096: public Object getElement(String elementName) {
097: return null;
098: }
099:
100: /**
101: * @see WSIFFormatHandler#setElement(String, Object)
102: */
103: public void setElement(String elementName, Object element) {
104: }
105:
106: /**
107: * @see WSIFFormatHandler#getElement(String, int)
108: */
109: public Object getElement(String name, int index) {
110: return null;
111: }
112:
113: /**
114: * @see WSIFFormatHandler#setElement(String, int, Object)
115: */
116: public void setElement(String name, int index, Object value) {
117: }
118:
119: /**
120: * @see WSIFFormatHandler#getObjectPart()
121: */
122: public Object getObjectPart() {
123: return this .fieldValue;
124: }
125:
126: /**
127: * @see WSIFFormatHandler#getObjectPart(Class)
128: */
129: public Object getObjectPart(Class sourceClass) {
130: return null;
131: }
132:
133: /**
134: * @see WSIFFormatHandler#getCharPart()
135: */
136: public char getCharPart() {
137: return 0;
138: }
139:
140: /**
141: * @see WSIFFormatHandler#getBytePart()
142: */
143: public byte getBytePart() {
144: return 0;
145: }
146:
147: /**
148: * @see WSIFFormatHandler#getShortPart()
149: */
150: public short getShortPart() {
151: return 0;
152: }
153:
154: /**
155: * @see WSIFFormatHandler#getIntPart()
156: */
157: public int getIntPart() {
158: return 0;
159: }
160:
161: /**
162: * @see WSIFFormatHandler#getLongPart()
163: */
164: public long getLongPart() {
165: return 0;
166: }
167:
168: /**
169: * @see WSIFFormatHandler#getFloatPart()
170: */
171: public float getFloatPart() {
172: return 0;
173: }
174:
175: /**
176: * @see WSIFFormatHandler#getDoublePart()
177: */
178: public double getDoublePart() {
179: return 0;
180: }
181:
182: /**
183: * @see WSIFFormatHandler#setObjectPart(Object)
184: */
185: public void setObjectPart(Object objectPart) {
186: this .fieldValue = (String) objectPart;
187: }
188:
189: /**
190: * @see WSIFFormatHandler#setCharPart(char)
191: */
192: public void setCharPart(char charPart) {
193: }
194:
195: /**
196: * @see WSIFFormatHandler#setBytePart(byte)
197: */
198: public void setBytePart(byte bytePart) {
199: }
200:
201: /**
202: * @see WSIFFormatHandler#setShortPart(short)
203: */
204: public void setShortPart(short shortPart) {
205: }
206:
207: /**
208: * @see WSIFFormatHandler#setIntPart(int)
209: */
210: public void setIntPart(int intPart) {
211: }
212:
213: /**
214: * @see WSIFFormatHandler#setLongPart(long)
215: */
216: public void setLongPart(long longPart) {
217: }
218:
219: /**
220: * @see WSIFFormatHandler#setFloatPart(float)
221: */
222: public void setFloatPart(float floatPart) {
223: }
224:
225: /**
226: * @see WSIFFormatHandler#setDoublePart(double)
227: */
228: public void setDoublePart(double doublePart) {
229: }
230:
231: public void setPartQName(javax.xml.namespace.QName qname) {
232: }
233:
234: public javax.xml.namespace.QName getPartQName() {
235: return null;
236: }
237:
238: public void setInteractionSpec(javax.resource.cci.InteractionSpec is) {
239:
240: }
241:
242: }
|