KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > xml > wsdl > ui > property > model > Property


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19
20 /**
21  * This generated bean class Property
22  * matches the schema element 'Property'.
23  * The root bean class is ElementProperties
24  *
25  * ===============================================================
26  * Property represents each attribute that would be created for the Node in the wsdleditor tree.
27  * It defines a way to specify customizers for attributes.
28  * There are 3 types of Property customizers:
29  * SchemaCustomizer : The default Customizer is the SchemaCustomizer, which shows drop downs for enumerations and boolean attributes,
30  * and String customizer for all other types. So if there is no Property defined for a attribute, it will have
31  * SchemaCustomizer.
32  * BuiltInCustomizer : specifies a way to put already defined customizer to be shown. Examples are part chooser, message chooser etc.
33  * NewCustomizer : provides a way to create a custom customizer specific to the user requirement. When using this the developer has
34  * to implement the SPI org.netbeans.modules.xml.wsdl.ui.spi.WSDLLookupProvider, and add a implementation of
35  * org.netbeans.modules.xml.wsdl.ui.spi.NewCustomizerProvider, which will provide the custom Node.Property to be shown in the
36  * wsdl editor property sheet.
37  *
38  * ===============================================================
39  * Generated on Mon Feb 05 17:54:51 PST 2007
40  * @Generated
41  */

42
43 package org.netbeans.modules.xml.wsdl.ui.property.model;
44
45 public class Property {
46     public static final String JavaDoc ATTRIBUTENAME = "AttributeName"; // NOI18N
47
public static final String JavaDoc ISNAMEABLEATTRIBUTE = "IsNameableAttribute"; // NOI18N
48
public static final String JavaDoc DECORATORATTRIBUTE = "DecoratorAttribute"; // NOI18N
49
public static final String JavaDoc GROUPNAME = "GroupName"; // NOI18N
50
public static final String JavaDoc PROPERTYORDER = "PropertyOrder"; // NOI18N
51
public static final String JavaDoc SCHEMACUSTOMIZER = "SchemaCustomizer"; // NOI18N
52
public static final String JavaDoc BUILTINCUSTOMIZER = "BuiltInCustomizer"; // NOI18N
53
public static final String JavaDoc NEWCUSTOMIZER = "NewCustomizer"; // NOI18N
54

55     private java.lang.String JavaDoc _AttributeName;
56     private boolean _IsNameableAttribute = false;
57     private javax.xml.namespace.QName JavaDoc _DecoratorAttribute;
58     private java.lang.String JavaDoc _GroupName;
59     private int _PropertyOrder;
60     private java.lang.Boolean JavaDoc _SchemaCustomizer;
61     private BuiltInCustomizer _BuiltInCustomizer;
62     private String JavaDoc _NewCustomizer;
63
64     /**
65      * Normal starting point constructor.
66      */

67     public Property() {
68         _AttributeName = "";
69     }
70
71     /**
72      * Required parameters constructor
73      */

74     public Property(java.lang.String JavaDoc attributeName, boolean isNameableAttribute) {
75         _AttributeName = attributeName;
76         _IsNameableAttribute = isNameableAttribute;
77     }
78
79     /**
80      * Deep copy
81      */

82     public Property(org.netbeans.modules.xml.wsdl.ui.property.model.Property source) {
83         this(source, false);
84     }
85
86     /**
87      * Deep copy
88      * @param justData just copy the XML relevant data
89      */

90     public Property(org.netbeans.modules.xml.wsdl.ui.property.model.Property source, boolean justData) {
91         _AttributeName = source._AttributeName;
92         _IsNameableAttribute = source._IsNameableAttribute;
93         _DecoratorAttribute = source._DecoratorAttribute;
94         _GroupName = source._GroupName;
95         _PropertyOrder = source._PropertyOrder;
96         _SchemaCustomizer = source._SchemaCustomizer;
97         _BuiltInCustomizer = (source._BuiltInCustomizer == null) ? null : newBuiltInCustomizer(source._BuiltInCustomizer, justData);
98         _NewCustomizer = source._NewCustomizer;
99     }
100
101     // This attribute is mandatory
102
public void setAttributeName(java.lang.String JavaDoc value) {
103         _AttributeName = value;
104     }
105
106     public java.lang.String JavaDoc getAttributeName() {
107         return _AttributeName;
108     }
109
110     // This attribute is mandatory
111
public void setIsNameableAttribute(boolean value) {
112         _IsNameableAttribute = value;
113     }
114
115     public boolean isIsNameableAttribute() {
116         return _IsNameableAttribute;
117     }
118
119     // This attribute is optional
120
public void setDecoratorAttribute(javax.xml.namespace.QName JavaDoc value) {
121         _DecoratorAttribute = value;
122     }
123
124     public javax.xml.namespace.QName JavaDoc getDecoratorAttribute() {
125         return _DecoratorAttribute;
126     }
127
128     // This attribute is optional
129
public void setGroupName(java.lang.String JavaDoc value) {
130         _GroupName = value;
131     }
132
133     public java.lang.String JavaDoc getGroupName() {
134         return _GroupName;
135     }
136
137     // This attribute is optional
138
public void setPropertyOrder(int value) {
139         _PropertyOrder = value;
140     }
141
142     public int getPropertyOrder() {
143         return _PropertyOrder;
144     }
145
146     // This attribute is mandatory
147
public void setSchemaCustomizer(java.lang.Boolean JavaDoc value) {
148         _SchemaCustomizer = value;
149         if (value != null) {
150             // It's a mutually exclusive property.
151
setBuiltInCustomizer(null);
152             setNewCustomizer(null);
153         }
154     }
155
156     public java.lang.Boolean JavaDoc getSchemaCustomizer() {
157         return _SchemaCustomizer;
158     }
159
160     // This attribute is mandatory
161
public void setBuiltInCustomizer(org.netbeans.modules.xml.wsdl.ui.property.model.BuiltInCustomizer value) {
162         _BuiltInCustomizer = value;
163         if (value != null) {
164             // It's a mutually exclusive property.
165
setSchemaCustomizer(null);
166             setNewCustomizer(null);
167         }
168     }
169
170     public org.netbeans.modules.xml.wsdl.ui.property.model.BuiltInCustomizer getBuiltInCustomizer() {
171         return _BuiltInCustomizer;
172     }
173
174     // This attribute is mandatory
175
public void setNewCustomizer(String JavaDoc value) {
176         _NewCustomizer = value;
177         if (value != null) {
178             // It's a mutually exclusive property.
179
setSchemaCustomizer(null);
180             setBuiltInCustomizer(null);
181         }
182     }
183
184     public String JavaDoc getNewCustomizer() {
185         return _NewCustomizer;
186     }
187
188     /**
189      * Create a new bean using it's default constructor.
190      * This does not add it to any bean graph.
191      */

192     public org.netbeans.modules.xml.wsdl.ui.property.model.BuiltInCustomizer newBuiltInCustomizer() {
193         return new org.netbeans.modules.xml.wsdl.ui.property.model.BuiltInCustomizer();
194     }
195
196     /**
197      * Create a new bean, copying from another one.
198      * This does not add it to any bean graph.
199      */

200     public org.netbeans.modules.xml.wsdl.ui.property.model.BuiltInCustomizer newBuiltInCustomizer(BuiltInCustomizer source, boolean justData) {
201         return new org.netbeans.modules.xml.wsdl.ui.property.model.BuiltInCustomizer(source, justData);
202     }
203
204     public void writeNode(java.io.Writer JavaDoc out) throws java.io.IOException JavaDoc {
205         String JavaDoc myName;
206         myName = "Property";
207         writeNode(out, myName, ""); // NOI18N
208
}
209
210     public void writeNode(java.io.Writer JavaDoc out, String JavaDoc nodeName, String JavaDoc indent) throws java.io.IOException JavaDoc {
211         writeNode(out, nodeName, null, indent, new java.util.HashMap JavaDoc());
212     }
213
214     /**
215      * It's not recommended to call this method directly.
216      */

217     public void writeNode(java.io.Writer JavaDoc out, String JavaDoc nodeName, String JavaDoc namespace, String JavaDoc indent, java.util.Map JavaDoc namespaceMap) throws java.io.IOException JavaDoc {
218         out.write(indent);
219         out.write("<");
220         if (namespace != null) {
221             out.write((String JavaDoc)namespaceMap.get(namespace));
222             out.write(":");
223         }
224         out.write(nodeName);
225         // Work out any namespaces.
226
boolean firstNSAddition = true;
227         if (_DecoratorAttribute != null && _DecoratorAttribute.getNamespaceURI() != null && !"".equals(_DecoratorAttribute.getNamespaceURI())) {
228             String JavaDoc prefix = (String JavaDoc) namespaceMap.get(_DecoratorAttribute.getNamespaceURI());
229             if (prefix == null || "".equals(prefix)) {
230                 prefix = _DecoratorAttribute.getPrefix();
231                 if (prefix == null || "".equals(prefix)) {
232                     prefix = "decoratorAttribute_ns__";
233                 }
234                 // Need to make sure it's a unique prefix too.
235
boolean changed;
236                 do {
237                     changed = false;
238                     for (java.util.Iterator JavaDoc valueIt = namespaceMap.values().iterator();
239                         valueIt.hasNext(); ) {
240                         String JavaDoc otherPrefix = (String JavaDoc) valueIt.next();
241                         if (prefix.equals(otherPrefix)) {
242                             prefix += "_";
243                             changed = true;
244                         }
245                     }
246                 } while (changed);
247                 if (firstNSAddition) {
248                     firstNSAddition = false;
249                     // Copy on write
250
namespaceMap = new java.util.HashMap JavaDoc(namespaceMap);
251                 }
252                 namespaceMap.put(_DecoratorAttribute.getNamespaceURI(), prefix);
253                 out.write(" xmlns:");
254                 out.write(prefix);
255                 out.write("='");
256                 out.write(_DecoratorAttribute.getNamespaceURI());
257                 out.write("'");
258             }
259         }
260         writeNodeAttributes(out, nodeName, namespace, indent, namespaceMap);
261         out.write(">\n");
262         writeNodeChildren(out, nodeName, namespace, indent, namespaceMap);
263         out.write(indent);
264         out.write("</");
265         if (namespace != null) {
266             out.write((String JavaDoc)namespaceMap.get(namespace));
267             out.write(":");
268         }
269         out.write(nodeName);
270         out.write(">\n");
271     }
272
273     protected void writeNodeAttributes(java.io.Writer JavaDoc out, String JavaDoc nodeName, String JavaDoc namespace, String JavaDoc indent, java.util.Map JavaDoc namespaceMap) throws java.io.IOException JavaDoc {
274         // attributeName is an attribute with namespace http://xml.netbeans.org/schema/wsdlui/property
275
if (_AttributeName != null) {
276             out.write(" attributeName='");
277             org.netbeans.modules.xml.wsdl.ui.property.model.ElementProperties.writeXML(out, _AttributeName, true);
278             out.write("'"); // NOI18N
279
}
280         // isNameableAttribute is an attribute with namespace http://xml.netbeans.org/schema/wsdlui/property
281
out.write(" isNameableAttribute='");
282         out.write(_IsNameableAttribute ? "true" : "false");
283         out.write("'"); // NOI18N
284
// decoratorAttribute is an attribute with namespace http://xml.netbeans.org/schema/wsdlui/property
285
if (_DecoratorAttribute != null) {
286             out.write(" decoratorAttribute='");
287             if (_DecoratorAttribute.getNamespaceURI() != null && !"".equals(_DecoratorAttribute.getNamespaceURI())) {
288                 out.write((String JavaDoc) namespaceMap.get(_DecoratorAttribute.getNamespaceURI()));
289                 out.write(":");
290             }
291             org.netbeans.modules.xml.wsdl.ui.property.model.ElementProperties.writeXML(out, _DecoratorAttribute.getLocalPart(), true);
292             out.write("'"); // NOI18N
293
}
294         // groupName is an attribute with namespace http://xml.netbeans.org/schema/wsdlui/property
295
if (_GroupName != null) {
296             out.write(" groupName='");
297             org.netbeans.modules.xml.wsdl.ui.property.model.ElementProperties.writeXML(out, _GroupName, true);
298             out.write("'"); // NOI18N
299
}
300         // propertyOrder is an attribute with namespace http://xml.netbeans.org/schema/wsdlui/property
301
out.write(" propertyOrder='");
302         out.write(""+_PropertyOrder);
303         out.write("'"); // NOI18N
304
}
305
306     protected void writeNodeChildren(java.io.Writer JavaDoc out, String JavaDoc nodeName, String JavaDoc namespace, String JavaDoc indent, java.util.Map JavaDoc namespaceMap) throws java.io.IOException JavaDoc {
307         String JavaDoc nextIndent = indent + " ";
308         if (_SchemaCustomizer != null) {
309             out.write(nextIndent);
310             out.write("<SchemaCustomizer"); // NOI18N
311
out.write(">"); // NOI18N
312
out.write(_SchemaCustomizer.toString());
313             out.write("</SchemaCustomizer>\n"); // NOI18N
314
}
315         if (_BuiltInCustomizer != null) {
316             _BuiltInCustomizer.writeNode(out, "BuiltInCustomizer", null, nextIndent, namespaceMap);
317         }
318         if (_NewCustomizer != null) {
319             out.write(nextIndent);
320             out.write("<NewCustomizer"); // NOI18N
321
out.write(">"); // NOI18N
322
org.netbeans.modules.xml.wsdl.ui.property.model.ElementProperties.writeXML(out, _NewCustomizer, false);
323             out.write("</NewCustomizer>\n"); // NOI18N
324
}
325     }
326
327     public void readNode(org.w3c.dom.Node JavaDoc node) {
328         readNode(node, new java.util.HashMap JavaDoc());
329     }
330
331     public void readNode(org.w3c.dom.Node JavaDoc node, java.util.Map JavaDoc namespacePrefixes) {
332         if (node.hasAttributes()) {
333             org.w3c.dom.NamedNodeMap JavaDoc attrs = node.getAttributes();
334             org.w3c.dom.Attr JavaDoc attr;
335             java.lang.String JavaDoc attrValue;
336             boolean firstNamespaceDef = true;
337             for (int attrNum = 0; attrNum < attrs.getLength(); ++attrNum) {
338                 attr = (org.w3c.dom.Attr JavaDoc) attrs.item(attrNum);
339                 String JavaDoc attrName = attr.getName();
340                 if (attrName.startsWith("xmlns:")) {
341                     if (firstNamespaceDef) {
342                         firstNamespaceDef = false;
343                         // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries.
344
namespacePrefixes = new java.util.HashMap JavaDoc(namespacePrefixes);
345                     }
346                     String JavaDoc attrNSPrefix = attrName.substring(6, attrName.length());
347                     namespacePrefixes.put(attrNSPrefix, attr.getValue());
348                 }
349             }
350             readNodeAttributes(node, namespacePrefixes, attrs);
351         }
352         readNodeChildren(node, namespacePrefixes);
353     }
354
355     protected void readNodeAttributes(org.w3c.dom.Node JavaDoc node, java.util.Map JavaDoc namespacePrefixes, org.w3c.dom.NamedNodeMap JavaDoc attrs) {
356         org.w3c.dom.Attr JavaDoc attr;
357         java.lang.String JavaDoc attrValue;
358         attr = (org.w3c.dom.Attr JavaDoc) attrs.getNamedItem("attributeName");
359         if (attr != null) {
360             attrValue = attr.getValue();
361             _AttributeName = attrValue;
362         }
363         attr = (org.w3c.dom.Attr JavaDoc) attrs.getNamedItem("isNameableAttribute");
364         if (attr != null) {
365             attrValue = attr.getValue();
366             _IsNameableAttribute = java.lang.Boolean.valueOf(attrValue).booleanValue();
367         }
368         attr = (org.w3c.dom.Attr JavaDoc) attrs.getNamedItem("decoratorAttribute");
369         if (attr != null) {
370             attrValue = attr.getValue();
371             int colonPos = attrValue.indexOf(':');
372             if (colonPos < 0) {
373                 _DecoratorAttribute = new javax.xml.namespace.QName JavaDoc(attrValue);
374             } else {
375                 java.util.Map JavaDoc nsPrefixes = new java.util.HashMap JavaDoc(namespacePrefixes);
376                 for (int attrNum = 0; attrNum < attrs.getLength();
377                     ++attrNum) {
378                     attr = (org.w3c.dom.Attr JavaDoc) attrs.item(attrNum);
379                     String JavaDoc attrName = attr.getName();
380                     if (attrName.startsWith("xmlns:")) {
381                         String JavaDoc attrNSPrefix = attrName.substring(6, attrName.length());
382                         nsPrefixes.put(attrNSPrefix, attr.getValue());
383                     }
384                 }
385                 String JavaDoc prefix = attrValue.substring(0, colonPos);
386                 String JavaDoc ns = (String JavaDoc) nsPrefixes.get(prefix);
387                 String JavaDoc localPart = attrValue.substring(colonPos+1, attrValue.length());
388                 _DecoratorAttribute = new javax.xml.namespace.QName JavaDoc(ns, localPart, prefix);
389             }
390         }
391         attr = (org.w3c.dom.Attr JavaDoc) attrs.getNamedItem("groupName");
392         if (attr != null) {
393             attrValue = attr.getValue();
394             _GroupName = attrValue;
395         }
396         attr = (org.w3c.dom.Attr JavaDoc) attrs.getNamedItem("propertyOrder");
397         if (attr != null) {
398             attrValue = attr.getValue();
399             _PropertyOrder = Integer.parseInt(attrValue);
400         }
401     }
402
403     protected void readNodeChildren(org.w3c.dom.Node JavaDoc node, java.util.Map JavaDoc namespacePrefixes) {
404         org.w3c.dom.NodeList JavaDoc children = node.getChildNodes();
405         for (int i = 0, size = children.getLength(); i < size; ++i) {
406             org.w3c.dom.Node JavaDoc childNode = children.item(i);
407             String JavaDoc childNodeName = (childNode.getLocalName() == null ? childNode.getNodeName().intern() : childNode.getLocalName().intern());
408             String JavaDoc childNodeValue = "";
409             if (childNode.getFirstChild() != null) {
410                 childNodeValue = childNode.getFirstChild().getNodeValue();
411             }
412             org.w3c.dom.NamedNodeMap JavaDoc attrs = childNode.getAttributes();
413             org.w3c.dom.Attr JavaDoc attr;
414             java.lang.String JavaDoc attrValue;
415             if (childNodeName == "SchemaCustomizer") {
416                 if (childNode.getFirstChild() == null)
417                     _SchemaCustomizer = Boolean.TRUE;
418                 else
419                     _SchemaCustomizer = java.lang.Boolean.valueOf(childNodeValue);
420             }
421             else if (childNodeName == "BuiltInCustomizer") {
422                 _BuiltInCustomizer = newBuiltInCustomizer();
423                 _BuiltInCustomizer.readNode(childNode, namespacePrefixes);
424             }
425             else if (childNodeName == "NewCustomizer") {
426                 _NewCustomizer = childNodeValue;
427             }
428             else {
429                 // Found extra unrecognized childNode
430
}
431         }
432     }
433
434     public void changePropertyByName(String JavaDoc name, Object JavaDoc value) {
435         if (name == null) return;
436         name = name.intern();
437         if (name == "attributeName")
438             setAttributeName((java.lang.String JavaDoc)value);
439         else if (name == "isNameableAttribute")
440             setIsNameableAttribute(((java.lang.Boolean JavaDoc)value).booleanValue());
441         else if (name == "decoratorAttribute")
442             setDecoratorAttribute((javax.xml.namespace.QName JavaDoc)value);
443         else if (name == "groupName")
444             setGroupName((java.lang.String JavaDoc)value);
445         else if (name == "propertyOrder")
446             setPropertyOrder(((java.lang.Integer JavaDoc)value).intValue());
447         else if (name == "schemaCustomizer")
448             setSchemaCustomizer((java.lang.Boolean JavaDoc)value);
449         else if (name == "builtInCustomizer")
450             setBuiltInCustomizer((BuiltInCustomizer)value);
451         else if (name == "newCustomizer")
452             setNewCustomizer((String JavaDoc)value);
453         else
454             throw new IllegalArgumentException JavaDoc(name+" is not a valid property name for Property");
455     }
456
457     public Object JavaDoc fetchPropertyByName(String JavaDoc name) {
458         if (name == "attributeName")
459             return getAttributeName();
460         if (name == "isNameableAttribute")
461             return (isIsNameableAttribute() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
462         if (name == "decoratorAttribute")
463             return getDecoratorAttribute();
464         if (name == "groupName")
465             return getGroupName();
466         if (name == "propertyOrder")
467             return new java.lang.Integer JavaDoc(getPropertyOrder());
468         if (name == "schemaCustomizer")
469             return getSchemaCustomizer();
470         if (name == "builtInCustomizer")
471             return getBuiltInCustomizer();
472         if (name == "newCustomizer")
473             return getNewCustomizer();
474         throw new IllegalArgumentException JavaDoc(name+" is not a valid property name for Property");
475     }
476
477     public String JavaDoc nameSelf() {
478         return "Property";
479     }
480
481     public String JavaDoc nameChild(Object JavaDoc childObj) {
482         return nameChild(childObj, false, false);
483     }
484
485     /**
486      * @param childObj The child object to search for
487      * @param returnSchemaName Whether or not the schema name should be returned or the property name
488      * @return null if not found
489      */

490     public String JavaDoc nameChild(Object JavaDoc childObj, boolean returnConstName, boolean returnSchemaName) {
491         return nameChild(childObj, returnConstName, returnSchemaName, false);
492     }
493
494     /**
495      * @param childObj The child object to search for
496      * @param returnSchemaName Whether or not the schema name should be returned or the property name
497      * @return null if not found
498      */

499     public String JavaDoc nameChild(Object JavaDoc childObj, boolean returnConstName, boolean returnSchemaName, boolean returnXPathName) {
500         if (childObj instanceof BuiltInCustomizer) {
501             BuiltInCustomizer child = (BuiltInCustomizer) childObj;
502             if (child == _BuiltInCustomizer) {
503                 if (returnConstName) {
504                     return BUILTINCUSTOMIZER;
505                 } else if (returnSchemaName) {
506                     return "BuiltInCustomizer";
507                 } else if (returnXPathName) {
508                     return "BuiltInCustomizer";
509                 } else {
510                     return "BuiltInCustomizer";
511                 }
512             }
513         }
514         if (childObj instanceof java.lang.Boolean JavaDoc) {
515             java.lang.Boolean JavaDoc child = (java.lang.Boolean JavaDoc) childObj;
516             if (((java.lang.Boolean JavaDoc)child).booleanValue() == _IsNameableAttribute) {
517                 if (returnConstName) {
518                     return ISNAMEABLEATTRIBUTE;
519                 } else if (returnSchemaName) {
520                     return "isNameableAttribute";
521                 } else if (returnXPathName) {
522                     return "@isNameableAttribute";
523                 } else {
524                     return "IsNameableAttribute";
525                 }
526             }
527             if (child == _SchemaCustomizer) {
528                 if (returnConstName) {
529                     return SCHEMACUSTOMIZER;
530                 } else if (returnSchemaName) {
531                     return "SchemaCustomizer";
532                 } else if (returnXPathName) {
533                     return "SchemaCustomizer";
534                 } else {
535                     return "SchemaCustomizer";
536                 }
537             }
538         }
539         if (childObj instanceof javax.xml.namespace.QName JavaDoc) {
540             javax.xml.namespace.QName JavaDoc child = (javax.xml.namespace.QName JavaDoc) childObj;
541             if (child == _DecoratorAttribute) {
542                 if (returnConstName) {
543                     return DECORATORATTRIBUTE;
544                 } else if (returnSchemaName) {
545                     return "decoratorAttribute";
546                 } else if (returnXPathName) {
547                     return "@decoratorAttribute";
548                 } else {
549                     return "DecoratorAttribute";
550                 }
551             }
552         }
553         if (childObj instanceof java.lang.Integer JavaDoc) {
554             java.lang.Integer JavaDoc child = (java.lang.Integer JavaDoc) childObj;
555             if (((java.lang.Integer JavaDoc)child).intValue() == _PropertyOrder) {
556                 if (returnConstName) {
557                     return PROPERTYORDER;
558                 } else if (returnSchemaName) {
559                     return "propertyOrder";
560                 } else if (returnXPathName) {
561                     return "@propertyOrder";
562                 } else {
563                     return "PropertyOrder";
564                 }
565             }
566         }
567         if (childObj instanceof java.lang.String JavaDoc) {
568             java.lang.String JavaDoc child = (java.lang.String JavaDoc) childObj;
569             if (child == _AttributeName) {
570                 if (returnConstName) {
571                     return ATTRIBUTENAME;
572                 } else if (returnSchemaName) {
573                     return "attributeName";
574                 } else if (returnXPathName) {
575                     return "@attributeName";
576                 } else {
577                     return "AttributeName";
578                 }
579             }
580             if (child == _GroupName) {
581                 if (returnConstName) {
582                     return GROUPNAME;
583                 } else if (returnSchemaName) {
584                     return "groupName";
585                 } else if (returnXPathName) {
586                     return "@groupName";
587                 } else {
588                     return "GroupName";
589                 }
590             }
591             if (child == _NewCustomizer) {
592                 if (returnConstName) {
593                     return NEWCUSTOMIZER;
594                 } else if (returnSchemaName) {
595                     return "NewCustomizer";
596                 } else if (returnXPathName) {
597                     return "NewCustomizer";
598                 } else {
599                     return "NewCustomizer";
600                 }
601             }
602         }
603         return null;
604     }
605
606     /**
607      * Return an array of all of the properties that are beans and are set.
608      */

609     public java.lang.Object JavaDoc[] childBeans(boolean recursive) {
610         java.util.List JavaDoc children = new java.util.LinkedList JavaDoc();
611         childBeans(recursive, children);
612         java.lang.Object JavaDoc[] result = new java.lang.Object JavaDoc[children.size()];
613         return (java.lang.Object JavaDoc[]) children.toArray(result);
614     }
615
616     /**
617      * Put all child beans into the beans list.
618      */

619     public void childBeans(boolean recursive, java.util.List JavaDoc beans) {
620         if (_BuiltInCustomizer != null) {
621             if (recursive) {
622                 _BuiltInCustomizer.childBeans(true, beans);
623             }
624             beans.add(_BuiltInCustomizer);
625         }
626     }
627
628     public boolean equals(Object JavaDoc o) {
629         return o instanceof org.netbeans.modules.xml.wsdl.ui.property.model.Property && equals((org.netbeans.modules.xml.wsdl.ui.property.model.Property) o);
630     }
631
632     public boolean equals(org.netbeans.modules.xml.wsdl.ui.property.model.Property inst) {
633         if (inst == this) {
634             return true;
635         }
636         if (inst == null) {
637             return false;
638         }
639         if (!(_AttributeName == null ? inst._AttributeName == null : _AttributeName.equals(inst._AttributeName))) {
640             return false;
641         }
642         if (!(_IsNameableAttribute == inst._IsNameableAttribute)) {
643             return false;
644         }
645         if (!(_DecoratorAttribute == null ? inst._DecoratorAttribute == null : _DecoratorAttribute.equals(inst._DecoratorAttribute))) {
646             return false;
647         }
648         if (!(_GroupName == null ? inst._GroupName == null : _GroupName.equals(inst._GroupName))) {
649             return false;
650         }
651         if (!(_PropertyOrder == inst._PropertyOrder)) {
652             return false;
653         }
654         if (!(_SchemaCustomizer == null ? inst._SchemaCustomizer == null : _SchemaCustomizer.equals(inst._SchemaCustomizer))) {
655             return false;
656         }
657         if (!(_BuiltInCustomizer == null ? inst._BuiltInCustomizer == null : _BuiltInCustomizer.equals(inst._BuiltInCustomizer))) {
658             return false;
659         }
660         if (!(_NewCustomizer == null ? inst._NewCustomizer == null : _NewCustomizer.equals(inst._NewCustomizer))) {
661             return false;
662         }
663         return true;
664     }
665
666     public int hashCode() {
667         int result = 17;
668         result = 37*result + (_AttributeName == null ? 0 : _AttributeName.hashCode());
669         result = 37*result + (_IsNameableAttribute ? 0 : 1);
670         result = 37*result + (_DecoratorAttribute == null ? 0 : _DecoratorAttribute.hashCode());
671         result = 37*result + (_GroupName == null ? 0 : _GroupName.hashCode());
672         result = 37*result + (_PropertyOrder);
673         result = 37*result + (_SchemaCustomizer == null ? 0 : _SchemaCustomizer.hashCode());
674         result = 37*result + (_BuiltInCustomizer == null ? 0 : _BuiltInCustomizer.hashCode());
675         result = 37*result + (_NewCustomizer == null ? 0 : _NewCustomizer.hashCode());
676         return result;
677     }
678
679 }
680
681
682 /*
683         The following schema file has been used for generation:
684
685 <?xml version="1.0" encoding="UTF-8"?>
686
687 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
688             targetNamespace="http://xml.netbeans.org/schema/wsdlui/property"
689             xmlns:tns="http://xml.netbeans.org/schema/wsdlui/property"
690             elementFormDefault="qualified">
691     <xsd:element name="ElementProperties">
692         <xsd:annotation>
693             <xsd:documentation xml:lang="en-US">Root node for specifying customizers for a element.
694                 This needs to be on the GlobalElement which would represent the node in the WSDL tree.
695             If this is defined in local elements it is ignored.</xsd:documentation>
696         </xsd:annotation>
697         <xsd:complexType>
698             <xsd:sequence>
699                 <xsd:element ref="tns:PropertyGroup" maxOccurs="unbounded" />
700                 <xsd:element ref="tns:Property" maxOccurs="unbounded" />
701                 <xsd:element ref="tns:GroupedProperty" maxOccurs="unbounded" />
702             </xsd:sequence>
703         </xsd:complexType>
704     </xsd:element>
705     
706     <xsd:element name="PropertyGroup">
707         <xsd:annotation>
708             <xsd:documentation xml:lang="en-US">Used to create groups in the property sheet.
709                 By default, if no groups are defined all the properties will be shown
710                 in the default Property sheet called "Properties".
711                 name : defines the name of the Group.
712                 groupOrder : defines the order in which the groups will be created. The groupOrder starts with 1.
713                 isDefault : overrides the default property sheet to be this group rather than "Properties".
714                 This enables the user to put non-customized properties (which do not have a Property defined in this xml) to go into this property sheet.
715                 
716                 
717             </xsd:documentation>
718         </xsd:annotation>
719         <xsd:complexType>
720             <xsd:attribute name="name" type="xsd:string" use="required"/>
721             <xsd:attribute name="groupOrder" type="xsd:int"/>
722             <xsd:attribute name="isDefault" type="xsd:boolean" default="false"/>
723         </xsd:complexType>
724     </xsd:element>
725     <xsd:element name="Property">
726         <xsd:annotation>
727             <xsd:documentation xml:lang="en-US">Property represents each attribute that would be created for the Node in the wsdleditor tree.
728                 It defines a way to specify customizers for attributes.
729                 There are 3 types of Property customizers:
730                 SchemaCustomizer : The default Customizer is the SchemaCustomizer, which shows drop downs for enumerations and boolean attributes,
731                 and String customizer for all other types. So if there is no Property defined for a attribute, it will have
732                 SchemaCustomizer.
733                 BuiltInCustomizer : specifies a way to put already defined customizer to be shown. Examples are part chooser, message chooser etc.
734                 NewCustomizer : provides a way to create a custom customizer specific to the user requirement. When using this the developer has
735                 to implement the SPI org.netbeans.modules.xml.wsdl.ui.spi.WSDLLookupProvider, and add a implementation of
736                 org.netbeans.modules.xml.wsdl.ui.spi.NewCustomizerProvider, which will provide the custom Node.Property to be shown in the
737                 wsdl editor property sheet.
738             </xsd:documentation>
739         </xsd:annotation>
740         <xsd:complexType>
741             <xsd:choice>
742                 <xsd:element name="SchemaCustomizer"/>
743                 <xsd:element name="BuiltInCustomizer">
744                     <xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema">
745                         <xsd:choice>
746                             <xsd:element name="DependsOnCustomizer">
747                                 <xsd:annotation>
748                                     <xsd:documentation xml:lang="en-US">Use a built-in customizer whose value(s) depend on some other attribute
749                                         of the the same element or some other source.
750                                     </xsd:documentation>
751                                 </xsd:annotation>
752                                 <xsd:complexType>
753                                     <xsd:choice>
754                                         <xsd:element name="StaticCustomizer">
755                                             <xsd:annotation>
756                                                 <xsd:documentation xml:lang="en-US">dependsOnAttributeName : the attribute on which the value(s) of the chooser would depend on.
757                                                     For example: some elements may have a attribute for message and another for part, and the PartsChooser should show parts from the message that is selected in the message attribute.
758                                                     In that the dependsOnAttributeName for PartChooser would be message.
759                                                 </xsd:documentation>
760                                             </xsd:annotation>
761                                             <xsd:complexType>
762                                                 <xsd:attribute name="dependsOnAttributeName" type="xsd:QName"/>
763                                             </xsd:complexType>
764                                         </xsd:element>
765                                         <!--No use case as of yet, xsd:element name="DynamicCustomizer">
766                                             <xsd:annotation>
767                                                 <xsd:documentation xml:lang="en-US">
768                                                     
769                                                 </xsd:documentation>
770                                             </xsd:annotation>
771                                             <xsd:complexType>
772                                                 <xsd:attribute name="dependsOnAttributeValueType" type="xsd:string"/>
773                                                 <xsd:attribute name="attributeValueProviderClass" type="xsd:string"/>
774                                             </xsd:complexType>
775                                         </xsd:element-->
776                                     </xsd:choice>
777                                     <xsd:attribute name="name" type="tns:builtInCustomizerTypes"/>
778                                 </xsd:complexType>
779                             </xsd:element>
780                             <xsd:element name="SimpleCustomizer">
781                                 <xsd:annotation>
782                                     <xsd:documentation xml:lang="en-US">
783                                         Use the builtin chooser that are available (the names are defined under builtInCustomizerTypes simple type as enumerations,
784                                         name: specifies which builtin chooser to use.
785                                     </xsd:documentation>
786                                 </xsd:annotation>
787                                 <xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema">
788                                     <xsd:sequence/>
789                                     <xsd:attribute name="name" type="tns:builtInCustomizerTypes"/>
790                                 </xsd:complexType>
791                             </xsd:element>
792                         </xsd:choice>
793                     </xsd:complexType>
794                 </xsd:element>
795                 <xsd:element ref="tns:NewCustomizer"/>
796             </xsd:choice>
797             <xsd:attribute name="attributeName" type="xsd:string" use="required"/>
798             <xsd:attribute name="isNameableAttribute" type="xsd:boolean" default="false"/>
799             <xsd:attribute name="decoratorAttribute" type="xsd:QName"/>
800             <xsd:attribute name="groupName" type="xsd:string"/>
801             <xsd:attribute name="propertyOrder" type="xsd:int"/>
802         </xsd:complexType>
803     </xsd:element>
804     <xsd:element name="GroupedProperty">
805         <xsd:annotation>
806             <xsd:documentation xml:lang="en-US">Some attributes in a element are mutually exclusive, so in the UI, for unambiguous usage, the user may want to add a single property chooser for 2 or more attributes, which will set the appropriate attribute depending on some criteria that the customizer may determine.
807                 groupedAttributeNames : specify all the mutually exclusive attributes. There will be a single customizer for all these attributes.
808                 groupName : specifies which PropertyGroup this belongs to.
809                 propertyOrder : specifies the order in the PropertyGroup where this property would be placed.
810                 displayName: specifies the Display name of the combined chooser.
811             </xsd:documentation>
812         </xsd:annotation>
813         <xsd:complexType>
814             <xsd:choice>
815                 <xsd:element name="BuiltInCustomizer" >
816                     <xsd:annotation>
817                         <xsd:documentation xml:lang="en-US">To use pre-built customizers.
818                         </xsd:documentation>
819                     </xsd:annotation>
820                     <xsd:complexType>
821                         <xsd:choice>
822                             <xsd:element name="ElementOrTypeChooser">
823                                 <xsd:annotation>
824                                     <xsd:documentation xml:lang="en-US">Shows a Tree based selector, which shows all the elements/types from Inline/Imported schemas.
825                                         elementAttributeName : the attribute on which GlobalElement data type would be set.
826                                         typeAttributeName : the attribute on which GlobalType data type would be set.
827                                     </xsd:documentation>
828                                 </xsd:annotation>
829                                 <xsd:complexType>
830                                     <xsd:attribute name="elementAttributeName" type="xsd:NCName"/>
831                                     <xsd:attribute name="typeAttributeName" type="xsd:NCName"/>
832                                 </xsd:complexType>
833                             </xsd:element>
834                             <xsd:element name="ElementOrTypeOrMessagePartChooser">
835                                 <xsd:annotation>
836                                     <xsd:documentation xml:lang="en-US">Shows a Tree based selector, which shows all the elements/types from Inline/Imported schemas and also the messages from all imported and existing wsdls.
837                                         elementAttributeName : the attribute on which GlobalElement data type would be set.
838                                         typeAttributeName : the attribute on which GlobalType data type would be set.
839                                         messageAttributeName : the attribute on which Message data type would be set.
840                                         partAttributeName : the attribute on which part would be set.
841                                         This chooser can select between a GlobalElement or GlobalType or a wsdl Part.
842                                         
843                                     </xsd:documentation>
844                                 </xsd:annotation>
845                                 <xsd:complexType>
846                                     <xsd:attribute name="elementAttributeName" type="xsd:NCName"/>
847                                     <xsd:attribute name="typeAttributeName" type="xsd:NCName"/>
848                                     <xsd:attribute name="messageAttributeName" type="xsd:NCName"/>
849                                     <xsd:attribute name="partAttributeName" type="xsd:NCName"/>
850                                 </xsd:complexType>
851                             </xsd:element>
852                         </xsd:choice>
853                     </xsd:complexType>
854                 </xsd:element>
855                 <xsd:element ref="tns:NewCustomizer"/>
856             </xsd:choice>
857             <xsd:attribute name="groupedAttributeNames" type="tns:attributeList" use="required"/>
858             <xsd:attribute name="groupName" type="xsd:string"/>
859             <xsd:attribute name="propertyOrder" type="xsd:int"/>
860             <xsd:attribute name="displayName" type="xsd:NCName" use="required"/>
861         </xsd:complexType>
862     </xsd:element>
863     
864     
865     <xsd:element name="NewCustomizer">
866         <xsd:annotation>
867             <xsd:documentation xml:lang="en-US">Provides a way for developer to provide a custom property customizer for the attribute, if the builtin chooser dont satisfy their requirements.
868 When using this the developer has to implement the SPI org.netbeans.modules.xml.wsdl.ui.spi.WSDLLookupProvider, and add a implementation of org.netbeans.modules.xml.wsdl.ui.spi.NewCustomizerProvider, which will provide the custom Node.Property to be shown in the wsdl editor property sheet.
869             </xsd:documentation>
870         </xsd:annotation>
871     </xsd:element>
872     
873     
874     <xsd:simpleType name="builtInCustomizerTypes">
875         <xsd:restriction base="xsd:string">
876             <xsd:enumeration value="MessageChooser">
877                 <xsd:annotation>
878                     <xsd:documentation xml:lang="en-US">Shows a drop down of all messages in the current WSDL document and also ones in imported WSDL documents.</xsd:documentation>
879                 </xsd:annotation>
880             </xsd:enumeration>
881             <xsd:enumeration value="PartChooser">
882                 <xsd:annotation>
883                     <xsd:documentation xml:lang="en-US">Show a drop down of all parts for a message. By default, the chooser assumes that it is in the binding section under input/output/fault, and shows all the parts for the message selected in the input/output/fault.
884     If not, then the dependsOnCustomizer needs to be used to specify the attribute which represents the message, whose parts will be shown</xsd:documentation>
885                 </xsd:annotation>
886             </xsd:enumeration>
887             <xsd:enumeration value="PortTypeChooser">
888                 <xsd:annotation>
889                     <xsd:documentation xml:lang="en-US">Show a drop down of all port types in the WSDL Document/Imported WSDL Documents.</xsd:documentation>
890                 </xsd:annotation>
891             </xsd:enumeration>
892             <xsd:enumeration value="PartsChooser">
893                 <xsd:annotation>
894                     <xsd:documentation xml:lang="en-US">Show a dialog of all parts for a message, from which multiple parts can be selected. By default, the chooser assumes that it is in the binding section under input/output/fault, and shows all the parts for the message selected in the input/output/fault.
895     If not, then the dependsOnCustomizer needs to be used to specify the attribute which represents the message, whose parts will be shown</xsd:documentation>
896                 </xsd:annotation>
897             </xsd:enumeration>
898         </xsd:restriction>
899     </xsd:simpleType>
900     
901     <xsd:simpleType name="attributeList">
902         <xsd:list itemType="xsd:string"/>
903     </xsd:simpleType>
904     
905 </xsd:schema>
906
907 */

908
Popular Tags