KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > stockquote > wsifservice > GetQuoteOutputMessage


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