KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > common > dd > webservice > Webservices


1 /**
2  * This generated bean class Webservices matches the schema element webservices
3  *
4  * ===============================================================
5  *
6  *
7  * This group keeps the usage of the contained description related
8  * elements consistent across J2EE deployment descriptors.
9  *
10  * All elements may occur multiple times with different languages,
11  * to support localization of the content.
12  *
13  *
14  * ===============================================================
15  * Generated on Fri Apr 22 15:42:52 PDT 2005
16  *
17  * This class matches the root element of the XML Schema,
18  * and is the root of the following bean graph:
19  *
20  * webservices : Webservices
21  * [attr: version CDATA #FIXED 1.1 : java.math.BigDecimal]
22  * [attr: id CDATA #IMPLIED : java.lang.String]
23  * description : java.lang.String[0,n]
24  * [attr: id CDATA #IMPLIED : java.lang.String]
25  * [attr: xml:lang CDATA #IMPLIED : java.lang.String]
26  * display-name : java.lang.String[0,n]
27  * [attr: id CDATA #IMPLIED : java.lang.String]
28  * [attr: xml:lang CDATA #IMPLIED : java.lang.String]
29  * icon : IconType[0,n]
30  * [attr: xml:lang CDATA #IMPLIED : java.lang.String]
31  * [attr: id CDATA #IMPLIED : java.lang.String]
32  * small-icon : java.lang.String?
33  * large-icon : java.lang.String?
34  * webservice-description : WebserviceDescriptionType[1,n]
35  * [attr: id CDATA #IMPLIED : java.lang.String]
36  * description : java.lang.String?
37  * [attr: id CDATA #IMPLIED : java.lang.String]
38  * [attr: xml:lang CDATA #IMPLIED : java.lang.String]
39  * display-name : java.lang.String?
40  * [attr: id CDATA #IMPLIED : java.lang.String]
41  * [attr: xml:lang CDATA #IMPLIED : java.lang.String]
42  * icon : IconType?
43  * [attr: xml:lang CDATA #IMPLIED : java.lang.String]
44  * [attr: id CDATA #IMPLIED : java.lang.String]
45  * small-icon : java.lang.String?
46  * large-icon : java.lang.String?
47  * webservice-description-name : java.lang.String
48  * [attr: id CDATA #IMPLIED : java.lang.String]
49  * wsdl-file : java.lang.String
50  * jaxrpc-mapping-file : java.lang.String
51  * port-component : PortComponentType[1,n]
52  * [attr: id CDATA #IMPLIED : java.lang.String]
53  * description : java.lang.String?
54  * [attr: id CDATA #IMPLIED : java.lang.String]
55  * [attr: xml:lang CDATA #IMPLIED : java.lang.String]
56  * display-name : java.lang.String?
57  * [attr: id CDATA #IMPLIED : java.lang.String]
58  * [attr: xml:lang CDATA #IMPLIED : java.lang.String]
59  * icon : IconType?
60  * [attr: xml:lang CDATA #IMPLIED : java.lang.String]
61  * [attr: id CDATA #IMPLIED : java.lang.String]
62  * small-icon : java.lang.String?
63  * large-icon : java.lang.String?
64  * port-component-name : java.lang.String
65  * [attr: id CDATA #IMPLIED : java.lang.String]
66  * wsdl-port : javax.xml.namespace.QName
67  * [attr: id CDATA #IMPLIED : java.lang.String]
68  * service-endpoint-interface : java.lang.String
69  * service-impl-bean : ServiceImplBeanType
70  * [attr: id CDATA #IMPLIED : java.lang.String]
71  * | ejb-link : java.lang.String
72  * | servlet-link : java.lang.String
73  * handler : PortComponentHandlerType[0,n]
74  * [attr: id CDATA #IMPLIED : java.lang.String]
75  * description : java.lang.String[0,n]
76  * [attr: id CDATA #IMPLIED : java.lang.String]
77  * [attr: xml:lang CDATA #IMPLIED : java.lang.String]
78  * display-name : java.lang.String[0,n]
79  * [attr: id CDATA #IMPLIED : java.lang.String]
80  * [attr: xml:lang CDATA #IMPLIED : java.lang.String]
81  * icon : IconType[0,n]
82  * [attr: xml:lang CDATA #IMPLIED : java.lang.String]
83  * [attr: id CDATA #IMPLIED : java.lang.String]
84  * small-icon : java.lang.String?
85  * large-icon : java.lang.String?
86  * handler-name : java.lang.String
87  * [attr: id CDATA #IMPLIED : java.lang.String]
88  * handler-class : java.lang.String
89  * init-param : ParamValueType[0,n]
90  * [attr: id CDATA #IMPLIED : java.lang.String]
91  * description : java.lang.String[0,n]
92  * [attr: id CDATA #IMPLIED : java.lang.String]
93  * [attr: xml:lang CDATA #IMPLIED : java.lang.String]
94  * param-name : java.lang.String
95  * [attr: id CDATA #IMPLIED : java.lang.String]
96  * param-value : java.lang.String
97  * [attr: id CDATA #IMPLIED : java.lang.String]
98  * soap-header : javax.xml.namespace.QName[0,n]
99  * [attr: id CDATA #IMPLIED : java.lang.String]
100  * soap-role : java.lang.String[0,n]
101  * [attr: id CDATA #IMPLIED : java.lang.String]
102  *
103  */

104
105 package com.sun.enterprise.tools.common.dd.webservice;
106
107 import org.w3c.dom.*;
108 import org.netbeans.modules.schema2beans.*;
109 import java.beans.*;
110 import java.util.*;
111 import java.io.*;
112
113 // BEGIN_NOI18N
114

115 public class Webservices extends org.netbeans.modules.schema2beans.BaseBean
116 {
117
118     static Vector comparators = new Vector();
119
120     static public final String JavaDoc DESCRIPTION = "Description"; // NOI18N
121
static public final String JavaDoc DISPLAY_NAME = "DisplayName"; // NOI18N
122
static public final String JavaDoc ICON = "Icon"; // NOI18N
123
static public final String JavaDoc WEBSERVICE_DESCRIPTION = "WebserviceDescription"; // NOI18N
124

125     public Webservices() {
126         this(null, Common.USE_DEFAULT_VALUES);
127     }
128
129     public Webservices(org.w3c.dom.Node JavaDoc doc, int options) {
130         this(Common.NO_DEFAULT_VALUES);
131         try {
132             initFromNode(doc, options);
133         }
134         catch (Schema2BeansException e) {
135             e.printStackTrace();
136             throw new RuntimeException JavaDoc(e.getMessage());
137         }
138     }
139     protected void initFromNode(org.w3c.dom.Node JavaDoc doc, int options) throws Schema2BeansException
140     {
141         if (doc == null)
142         {
143             doc = GraphManager.createRootElementNode("webservices"); // NOI18N
144
if (doc == null)
145                 throw new Schema2BeansException("Cannot create DOM root"); // NOI18N
146
}
147         Node n = GraphManager.getElementNode("webservices", doc); // NOI18N
148
if (n == null)
149             throw new Schema2BeansException("Doc root not in the DOM graph"); // NOI18N
150
;
151
152         this.graphManager.setXmlDocument(doc);
153
154         // Entry point of the createBeans() recursive calls
155
this.createBean(n, this.graphManager());
156         this.initialize(options);
157     }
158     public Webservices(int options)
159     {
160         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
161         initOptions(options);
162     }
163     protected void initOptions(int options)
164     {
165         // The graph manager is allocated in the bean root
166
this.graphManager = new GraphManager(this);
167         this.createRoot("webservices", "Webservices", // NOI18N
168
Common.TYPE_1 | Common.TYPE_BEAN, Webservices.class);
169
170         // Properties (see root bean comments for the bean graph)
171
this.createProperty("description", // NOI18N
172
DESCRIPTION,
173             Common.TYPE_0_N | Common.TYPE_STRING | Common.TYPE_KEY,
174             java.lang.String JavaDoc.class);
175         this.createAttribute(DESCRIPTION, "id", "Id",
176                         AttrProp.CDATA | AttrProp.IMPLIED,
177                         null, null);
178         this.createAttribute(DESCRIPTION, "xml:lang", "XmlLang",
179                         AttrProp.CDATA | AttrProp.IMPLIED,
180                         null, null);
181         this.createProperty("display-name", // NOI18N
182
DISPLAY_NAME,
183             Common.TYPE_0_N | Common.TYPE_STRING | Common.TYPE_KEY,
184             java.lang.String JavaDoc.class);
185         this.createAttribute(DISPLAY_NAME, "id", "Id",
186                         AttrProp.CDATA | AttrProp.IMPLIED,
187                         null, null);
188         this.createAttribute(DISPLAY_NAME, "xml:lang", "XmlLang",
189                         AttrProp.CDATA | AttrProp.IMPLIED,
190                         null, null);
191         this.createProperty("icon", // NOI18N
192
ICON,
193             Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY,
194             IconType.class);
195         this.createAttribute(ICON, "xml:lang", "XmlLang",
196                         AttrProp.CDATA | AttrProp.IMPLIED,
197                         null, null);
198         this.createAttribute(ICON, "id", "Id",
199                         AttrProp.CDATA | AttrProp.IMPLIED,
200                         null, null);
201         this.createProperty("webservice-description", // NOI18N
202
WEBSERVICE_DESCRIPTION,
203             Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY,
204             WebserviceDescriptionType.class);
205         this.createAttribute(WEBSERVICE_DESCRIPTION, "id", "Id",
206                         AttrProp.CDATA | AttrProp.IMPLIED,
207                         null, null);
208         this.createAttribute("version", "Version",
209                         AttrProp.CDATA | AttrProp.FIXED,
210                         null, "1.1");
211         this.createAttribute("id", "Id",
212                         AttrProp.CDATA | AttrProp.IMPLIED,
213                         null, null);
214         this.initialize(options);
215     }
216
217     // Setting the default values of the properties
218
void initialize(int options)
219     {
220         setDefaultNamespace("http://java.sun.com/xml/ns/j2ee");
221
222     }
223
224     // This attribute is an array, possibly empty
225
public void setDescription(int index, java.lang.String JavaDoc value) {
226         this.setValue(DESCRIPTION, index, value);
227     }
228
229     //
230
public java.lang.String JavaDoc getDescription(int index) {
231         return (java.lang.String JavaDoc)this.getValue(DESCRIPTION, index);
232     }
233
234     // This attribute is an array, possibly empty
235
public void setDescription(java.lang.String JavaDoc[] value) {
236         this.setValue(DESCRIPTION, value);
237     }
238
239     //
240
public java.lang.String JavaDoc[] getDescription() {
241         return (java.lang.String JavaDoc[])this.getValues(DESCRIPTION);
242     }
243
244     // Return the number of properties
245
public int sizeDescription() {
246         return this.size(DESCRIPTION);
247     }
248
249     // Add a new element returning its index in the list
250
public int addDescription(java.lang.String JavaDoc value) {
251         return this.addValue(DESCRIPTION, value);
252     }
253
254     //
255
// Remove an element using its reference
256
// Returns the index the element had in the list
257
//
258
public int removeDescription(java.lang.String JavaDoc value) {
259         return this.removeValue(DESCRIPTION, value);
260     }
261
262     // This attribute is an array, possibly empty
263
public void setDisplayName(int index, java.lang.String JavaDoc value) {
264         this.setValue(DISPLAY_NAME, index, value);
265     }
266
267     //
268
public java.lang.String JavaDoc getDisplayName(int index) {
269         return (java.lang.String JavaDoc)this.getValue(DISPLAY_NAME, index);
270     }
271
272     // This attribute is an array, possibly empty
273
public void setDisplayName(java.lang.String JavaDoc[] value) {
274         this.setValue(DISPLAY_NAME, value);
275     }
276
277     //
278
public java.lang.String JavaDoc[] getDisplayName() {
279         return (java.lang.String JavaDoc[])this.getValues(DISPLAY_NAME);
280     }
281
282     // Return the number of properties
283
public int sizeDisplayName() {
284         return this.size(DISPLAY_NAME);
285     }
286
287     // Add a new element returning its index in the list
288
public int addDisplayName(java.lang.String JavaDoc value) {
289         return this.addValue(DISPLAY_NAME, value);
290     }
291
292     //
293
// Remove an element using its reference
294
// Returns the index the element had in the list
295
//
296
public int removeDisplayName(java.lang.String JavaDoc value) {
297         return this.removeValue(DISPLAY_NAME, value);
298     }
299
300     // This attribute is an array, possibly empty
301
public void setIcon(int index, IconType value) {
302         this.setValue(ICON, index, value);
303     }
304
305     //
306
public IconType getIcon(int index) {
307         return (IconType)this.getValue(ICON, index);
308     }
309
310     // This attribute is an array, possibly empty
311
public void setIcon(IconType[] value) {
312         this.setValue(ICON, value);
313     }
314
315     //
316
public IconType[] getIcon() {
317         return (IconType[])this.getValues(ICON);
318     }
319
320     // Return the number of properties
321
public int sizeIcon() {
322         return this.size(ICON);
323     }
324
325     // Add a new element returning its index in the list
326
public int addIcon(com.sun.enterprise.tools.common.dd.webservice.IconType value) {
327         return this.addValue(ICON, value);
328     }
329
330     //
331
// Remove an element using its reference
332
// Returns the index the element had in the list
333
//
334
public int removeIcon(com.sun.enterprise.tools.common.dd.webservice.IconType value) {
335         return this.removeValue(ICON, value);
336     }
337
338     // This attribute is an array containing at least one element
339
public void setWebserviceDescription(int index, WebserviceDescriptionType value) {
340         this.setValue(WEBSERVICE_DESCRIPTION, index, value);
341     }
342
343     //
344
public WebserviceDescriptionType getWebserviceDescription(int index) {
345         return (WebserviceDescriptionType)this.getValue(WEBSERVICE_DESCRIPTION, index);
346     }
347
348     // This attribute is an array containing at least one element
349
public void setWebserviceDescription(WebserviceDescriptionType[] value) {
350         this.setValue(WEBSERVICE_DESCRIPTION, value);
351     }
352
353     //
354
public WebserviceDescriptionType[] getWebserviceDescription() {
355         return (WebserviceDescriptionType[])this.getValues(WEBSERVICE_DESCRIPTION);
356     }
357
358     // Return the number of properties
359
public int sizeWebserviceDescription() {
360         return this.size(WEBSERVICE_DESCRIPTION);
361     }
362
363     // Add a new element returning its index in the list
364
public int addWebserviceDescription(com.sun.enterprise.tools.common.dd.webservice.WebserviceDescriptionType value) {
365         return this.addValue(WEBSERVICE_DESCRIPTION, value);
366     }
367
368     //
369
// Remove an element using its reference
370
// Returns the index the element had in the list
371
//
372
public int removeWebserviceDescription(com.sun.enterprise.tools.common.dd.webservice.WebserviceDescriptionType value) {
373         return this.removeValue(WEBSERVICE_DESCRIPTION, value);
374     }
375
376     //
377
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
378         comparators.add(c);
379     }
380
381     //
382
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
383         comparators.remove(c);
384     }
385     //
386
// This method returns the root of the bean graph
387
// Each call creates a new bean graph from the specified DOM graph
388
//
389
public static Webservices createGraph(org.w3c.dom.Node JavaDoc doc) {
390         return new Webservices(doc, Common.NO_DEFAULT_VALUES);
391     }
392
393     public static Webservices createGraph(java.io.InputStream JavaDoc in) {
394         return createGraph(in, false);
395     }
396
397     public static Webservices createGraph(java.io.InputStream JavaDoc in, boolean validate) {
398         try {
399             Document doc = GraphManager.createXmlDocument(in, validate);
400             return createGraph(doc);
401         }
402         catch (Exception JavaDoc t) {
403             t.printStackTrace();
404             throw new RuntimeException JavaDoc("DOM graph creation failed"); // NOI18N
405
}
406     }
407
408     //
409
// This method returns the root for a new empty bean graph
410
//
411
public static Webservices createGraph() {
412         return new Webservices();
413     }
414
415     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
416     }
417
418     // Special serializer: output XML as serialization
419
private void writeObject(java.io.ObjectOutputStream JavaDoc out) throws java.io.IOException JavaDoc{
420         ByteArrayOutputStream baos = new ByteArrayOutputStream();
421         write(baos);
422         String JavaDoc str = baos.toString();;
423         // System.out.println("str='"+str+"'");
424
out.writeUTF(str);
425     }
426     // Special deserializer: read XML as deserialization
427
private void readObject(java.io.ObjectInputStream JavaDoc in) throws java.io.IOException JavaDoc, ClassNotFoundException JavaDoc{
428         try{
429             init(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
430             String JavaDoc strDocument = in.readUTF();
431             // System.out.println("strDocument='"+strDocument+"'");
432
ByteArrayInputStream bais = new ByteArrayInputStream(strDocument.getBytes());
433             Document doc = GraphManager.createXmlDocument(bais, false);
434             initOptions(Common.NO_DEFAULT_VALUES);
435             initFromNode(doc, Common.NO_DEFAULT_VALUES);
436         }
437         catch (Schema2BeansException e) {
438             e.printStackTrace();
439             throw new RuntimeException JavaDoc(e.getMessage());
440         }
441     }
442
443     // Dump the content of this bean returning it as a String
444
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
445         String JavaDoc s;
446         Object JavaDoc o;
447         org.netbeans.modules.schema2beans.BaseBean n;
448         str.append(indent);
449         str.append("Description["+this.sizeDescription()+"]"); // NOI18N
450
for(int i=0; i<this.sizeDescription(); i++)
451         {
452             str.append(indent+"\t");
453             str.append("#"+i+":");
454             str.append(indent+"\t"); // NOI18N
455
str.append("<"); // NOI18N
456
s = this.getDescription(i);
457             str.append((s==null?"null":s.trim())); // NOI18N
458
str.append(">\n"); // NOI18N
459
this.dumpAttributes(DESCRIPTION, i, str, indent);
460         }
461
462         str.append(indent);
463         str.append("DisplayName["+this.sizeDisplayName()+"]"); // NOI18N
464
for(int i=0; i<this.sizeDisplayName(); i++)
465         {
466             str.append(indent+"\t");
467             str.append("#"+i+":");
468             str.append(indent+"\t"); // NOI18N
469
str.append("<"); // NOI18N
470
s = this.getDisplayName(i);
471             str.append((s==null?"null":s.trim())); // NOI18N
472
str.append(">\n"); // NOI18N
473
this.dumpAttributes(DISPLAY_NAME, i, str, indent);
474         }
475
476         str.append(indent);
477         str.append("Icon["+this.sizeIcon()+"]"); // NOI18N
478
for(int i=0; i<this.sizeIcon(); i++)
479         {
480             str.append(indent+"\t");
481             str.append("#"+i+":");
482             n = (org.netbeans.modules.schema2beans.BaseBean) this.getIcon(i);
483             if (n != null)
484                 n.dump(str, indent + "\t"); // NOI18N
485
else
486                 str.append(indent+"\tnull"); // NOI18N
487
this.dumpAttributes(ICON, i, str, indent);
488         }
489
490         str.append(indent);
491         str.append("WebserviceDescription["+this.sizeWebserviceDescription()+"]"); // NOI18N
492
for(int i=0; i<this.sizeWebserviceDescription(); i++)
493         {
494             str.append(indent+"\t");
495             str.append("#"+i+":");
496             n = (org.netbeans.modules.schema2beans.BaseBean) this.getWebserviceDescription(i);
497             if (n != null)
498                 n.dump(str, indent + "\t"); // NOI18N
499
else
500                 str.append(indent+"\tnull"); // NOI18N
501
this.dumpAttributes(WEBSERVICE_DESCRIPTION, i, str, indent);
502         }
503
504     }
505     public String JavaDoc dumpBeanNode(){
506         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
507         str.append("Webservices\n"); // NOI18N
508
this.dump(str, "\n "); // NOI18N
509
return str.toString();
510     }}
511
512 // END_NOI18N
513

514
515 /*
516  * The contents of this file are subject to the terms
517  * of the Common Development and Distribution License
518  * (the License). You may not use this file except in
519  * compliance with the License.
520  *
521  * You can obtain a copy of the license at
522  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
523  * glassfish/bootstrap/legal/CDDLv1.0.txt.
524  * See the License for the specific language governing
525  * permissions and limitations under the License.
526  *
527  * When distributing Covered Code, include this CDDL
528  * Header Notice in each file and include the License file
529  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
530  * If applicable, add the following below the CDDL Header,
531  * with the fields enclosed by brackets [] replaced by
532  * you own identifying information:
533  * "Portions Copyrighted [year] [name of copyright owner]"
534  *
535  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
536  */

537
Popular Tags