KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > stockquote > wsifservice > GetQuoteInputMessage


1 /*
2  * The Apache Software License, Version 1.1
3  *
4  *
5  * Copyright (c) 2002 The Apache Software Foundation. All rights
6  * reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * 1. Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  *
15  * 2. Redistributions in binary form must reproduce the above copyright
16  * notice, this list of conditions and the following disclaimer in
17  * the documentation and/or other materials provided with the
18  * distribution.
19  *
20  * 3. The end-user documentation included with the redistribution,
21  * if any, must include the following acknowledgment:
22  * "This product includes software developed by the
23  * Apache Software Foundation (http://www.apache.org/)."
24  * Alternately, this acknowledgment may appear in the software itself,
25  * if and wherever such third-party acknowledgments normally appear.
26  *
27  * 4. The names "WSIF" and "Apache Software Foundation" must
28  * not be used to endorse or promote products derived from this
29  * software without prior written permission. For written
30  * permission, please contact apache@apache.org.
31  *
32  * 5. Products derived from this software may not be called "Apache",
33  * nor may "Apache" appear in their name, without prior written
34  * permission of the Apache Software Foundation.
35  *
36  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
37  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
38  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
39  * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
40  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
43  * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
44  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
45  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
46  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
47  * SUCH DAMAGE.
48  * ====================================================================
49  *
50  * This software consists of voluntary contributions made by many
51  * individuals on behalf of the Apache Software Foundation and was
52  * originally based on software copyright (c) 2001, 2002, International
53  * Business Machines, Inc., http://www.apache.org. For more
54  * information on the Apache Software Foundation, please see
55  * <http://www.apache.org/>.
56  */

57
58 package stockquote.wsifservice;
59
60 import java.util.Iterator JavaDoc;
61 import java.util.List JavaDoc;
62 import java.util.Map JavaDoc;
63 import javax.wsdl.Message;
64
65 import org.apache.wsif.WSIFException;
66 import org.apache.wsif.WSIFMessage;
67
68 public class GetQuoteInputMessage implements WSIFMessage {
69     private String JavaDoc partNames[] = { "symbol" };
70     protected String JavaDoc _symbol;
71     private String JavaDoc representationStyle;
72
73     public GetQuoteInputMessage() {
74
75     }
76     public String JavaDoc getName() {
77         return "GetQuoteInput";
78     }
79     public void setName(String JavaDoc s) {
80     }
81     public java.util.Iterator JavaDoc getPartNames() {
82         System.err.println(this.getClass().getName() + "getPartNames");
83         List JavaDoc resp = new java.util.LinkedList JavaDoc();
84         for (int i = 0; i < partNames.length; i++) {
85             resp.add(partNames[i]);
86         }
87         return resp.iterator();
88     }
89     public String JavaDoc getPt_Symbol() {
90         return _symbol;
91     }
92     public void setPt_Symbol(String JavaDoc value) {
93         this._symbol = value;
94     }
95     public boolean getBooleanPart(String JavaDoc partName) {
96         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
97     }
98     public void setBooleanPart(String JavaDoc partName, boolean value) {
99         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
100     }
101     public char getCharPart(String JavaDoc partName) {
102         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
103     }
104     public void setCharPart(String JavaDoc partName, char value) {
105         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
106     }
107     public String JavaDoc getStringPart(String JavaDoc partName) {
108         if (partName.equals("symbol")) {
109             return _symbol;
110         } else
111             throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
112     }
113     public void setStringPart(String JavaDoc partName, String JavaDoc value) {
114         if (partName.equals("symbol")) {
115             this._symbol = value;
116         } else
117             throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
118     }
119     public byte getBytePart(String JavaDoc partName) {
120         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
121     }
122     public void setBytePart(String JavaDoc partName, byte value) {
123         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
124     }
125     public short getShortPart(String JavaDoc partName) {
126         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
127     }
128     public void setShortPart(String JavaDoc partName, short value) {
129         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
130     }
131     public int getIntPart(String JavaDoc partName) {
132         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
133     }
134     public void setIntPart(String JavaDoc partName, int value) {
135         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
136     }
137     public long getLongPart(String JavaDoc partName) {
138         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
139     }
140     public void setLongPart(String JavaDoc partName, long value) {
141         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
142     }
143     public float getFloatPart(String JavaDoc partName) {
144         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
145     }
146     public void setFloatPart(String JavaDoc partName, float value) {
147         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
148     }
149     public double getDoublePart(String JavaDoc partName) {
150         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
151     }
152     public void setDoublePart(String JavaDoc partName, double value) {
153         throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
154     }
155     public Object JavaDoc getObjectPart(String JavaDoc partName) {
156         if (partName.equals("symbol")) {
157             return _symbol;
158         } else
159             throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
160     }
161     public Object JavaDoc getObjectPart(String JavaDoc partName, Class JavaDoc sourceClass) {
162         if (partName.equals("symbol")) {
163             return _symbol;
164         } else
165             throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
166     }
167     public void setObjectPart(String JavaDoc partName, Object JavaDoc value) {
168         if (partName.equals("symbol")) {
169             this._symbol = (String JavaDoc) value;
170         } else
171             throw new IllegalArgumentException JavaDoc("Part " + partName + " not found");
172     }
173     public Iterator JavaDoc getParts() {
174         Map JavaDoc resp = new java.util.HashMap JavaDoc();
175         resp.put("symbol", _symbol);
176         return resp.values().iterator();
177     }
178     public void getParts(Map JavaDoc resp) {
179         resp.put("symbol", _symbol);
180     }
181     public void setParts(Map JavaDoc source) {
182         _symbol = (String JavaDoc) source.get("symbol");
183     }
184     private GetQuoteInputMessage(GetQuoteInputMessage msg) throws WSIFException {
185         this.partNames = msg.partNames;
186         this.representationStyle = msg.representationStyle;
187         this._symbol = new String JavaDoc(msg._symbol);
188     }
189     public String JavaDoc getRepresentationStyle() {
190         return representationStyle;
191     }
192     public void setRepresentationStyle(String JavaDoc style) {
193         representationStyle = style;
194     }
195     public Object JavaDoc clone() throws CloneNotSupportedException JavaDoc {
196         try {
197             return new GetQuoteInputMessage(this);
198         } catch (WSIFException ex) {
199             throw new CloneNotSupportedException JavaDoc(ex.getMessage());
200         }
201     }
202     
203     public Message getMessageDefinition() { return null; }
204     
205     public void setMessageDefinition(Message msgDef) {}
206 }
207
Popular Tags