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 stockquote.wsifservice;
059:
060: import java.util.Iterator;
061: import java.util.List;
062: import java.util.Map;
063:
064: import javax.wsdl.Message;
065:
066: import org.apache.wsif.WSIFException;
067: import org.apache.wsif.WSIFMessage;
068:
069: public class GetQuoteOutputMessage implements WSIFMessage {
070: private String partNames[] = { "quote" };
071: protected float _quote;
072: private String representationStyle;
073:
074: public GetQuoteOutputMessage() {
075:
076: }
077:
078: public String getName() {
079: return "GetQuoteOutput";
080: }
081:
082: public void setName(String s) {
083: }
084:
085: public java.util.Iterator getPartNames() {
086: System.err.println(this .getClass().getName() + "getPartNames");
087: List resp = new java.util.LinkedList();
088: for (int i = 0; i < partNames.length; i++) {
089: resp.add(partNames[i]);
090: }
091: return resp.iterator();
092: }
093:
094: public float getPt_Quote() {
095: return _quote;
096: }
097:
098: public void setPt_Quote(float value) {
099: this ._quote = value;
100: }
101:
102: public boolean getBooleanPart(String partName) {
103: throw new IllegalArgumentException("Part " + partName
104: + " not found");
105: }
106:
107: public void setBooleanPart(String partName, boolean value) {
108: throw new IllegalArgumentException("Part " + partName
109: + " not found");
110: }
111:
112: public char getCharPart(String partName) {
113: throw new IllegalArgumentException("Part " + partName
114: + " not found");
115: }
116:
117: public void setCharPart(String partName, char value) {
118: throw new IllegalArgumentException("Part " + partName
119: + " not found");
120: }
121:
122: public String getStringPart(String partName) {
123: throw new IllegalArgumentException("Part " + partName
124: + " not found");
125: }
126:
127: public void setStringPart(String partName, String value) {
128: throw new IllegalArgumentException("Part " + partName
129: + " not found");
130: }
131:
132: public byte getBytePart(String partName) {
133: throw new IllegalArgumentException("Part " + partName
134: + " not found");
135: }
136:
137: public void setBytePart(String partName, byte value) {
138: throw new IllegalArgumentException("Part " + partName
139: + " not found");
140: }
141:
142: public short getShortPart(String partName) {
143: throw new IllegalArgumentException("Part " + partName
144: + " not found");
145: }
146:
147: public void setShortPart(String partName, short value) {
148: throw new IllegalArgumentException("Part " + partName
149: + " not found");
150: }
151:
152: public int getIntPart(String partName) {
153: throw new IllegalArgumentException("Part " + partName
154: + " not found");
155: }
156:
157: public void setIntPart(String partName, int value) {
158: throw new IllegalArgumentException("Part " + partName
159: + " not found");
160: }
161:
162: public long getLongPart(String partName) {
163: throw new IllegalArgumentException("Part " + partName
164: + " not found");
165: }
166:
167: public void setLongPart(String partName, long value) {
168: throw new IllegalArgumentException("Part " + partName
169: + " not found");
170: }
171:
172: public float getFloatPart(String partName) {
173: if (partName.equals("quote")) {
174: return _quote;
175: } else
176: throw new IllegalArgumentException("Part " + partName
177: + " not found");
178: }
179:
180: public void setFloatPart(String partName, float value) {
181: if (partName.equals("quote")) {
182: this ._quote = value;
183: } else
184: throw new IllegalArgumentException("Part " + partName
185: + " not found");
186: }
187:
188: public double getDoublePart(String partName) {
189: throw new IllegalArgumentException("Part " + partName
190: + " not found");
191: }
192:
193: public void setDoublePart(String partName, double value) {
194: throw new IllegalArgumentException("Part " + partName
195: + " not found");
196: }
197:
198: public Object getObjectPart(String partName) {
199: if (partName.equals("quote")) {
200: return new Float(_quote);
201: } else
202: throw new IllegalArgumentException("Part " + partName
203: + " not found");
204: }
205:
206: public Object getObjectPart(String partName, Class sourceClass) {
207: if (partName.equals("quote")) {
208: return new Float(_quote);
209: } else
210: throw new IllegalArgumentException("Part " + partName
211: + " not found");
212: }
213:
214: public void setObjectPart(String partName, Object value) {
215: if (partName.equals("quote")) {
216: this ._quote = ((Float) value).floatValue();
217: } else
218: throw new IllegalArgumentException("Part " + partName
219: + " not found");
220: }
221:
222: public Iterator getParts() {
223: Map resp = new java.util.HashMap();
224: resp.put("quote", new Float(_quote));
225: return resp.values().iterator();
226: }
227:
228: public void getParts(Map resp) {
229: resp.put("quote", new Float(_quote));
230: }
231:
232: public void setParts(Map source) {
233: _quote = ((Float) source.get("quote")).floatValue();
234: }
235:
236: private GetQuoteOutputMessage(GetQuoteOutputMessage msg)
237: throws WSIFException {
238: this .partNames = msg.partNames;
239: this .representationStyle = msg.representationStyle;
240: this ._quote = msg._quote;
241: }
242:
243: public String getRepresentationStyle() {
244: return representationStyle;
245: }
246:
247: public void setRepresentationStyle(String style) {
248: representationStyle = style;
249: }
250:
251: public Object clone() throws CloneNotSupportedException {
252: try {
253: return new GetQuoteOutputMessage(this );
254: } catch (WSIFException ex) {
255: throw new CloneNotSupportedException(ex.getMessage());
256: }
257: }
258:
259: public Message getMessageDefinition() {
260: return null;
261: }
262:
263: public void setMessageDefinition(Message msgDef) {
264: }
265: }
|