KickJava   Java API By Example, From Geeks To Geeks.

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


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 NewCustomizer
22  * matches the schema element 'NewCustomizer'.
23  * The root bean class is ElementProperties
24  *
25  * Generated on Tue Jan 30 20:45:13 PST 2007
26  * @Generated
27  */

28
29 package org.netbeans.modules.xml.wsdl.ui.property.model;
30
31 public class NewCustomizer {
32     public static final String JavaDoc CLASSNAME = "ClassName"; // NOI18N
33

34     private java.lang.String JavaDoc _ClassName;
35
36     /**
37      * Normal starting point constructor.
38      */

39     public NewCustomizer() {
40     }
41
42     /**
43      * Deep copy
44      */

45     public NewCustomizer(org.netbeans.modules.xml.wsdl.ui.property.model.NewCustomizer source) {
46         this(source, false);
47     }
48
49     /**
50      * Deep copy
51      * @param justData just copy the XML relevant data
52      */

53     public NewCustomizer(org.netbeans.modules.xml.wsdl.ui.property.model.NewCustomizer source, boolean justData) {
54         _ClassName = source._ClassName;
55     }
56
57     // This attribute is optional
58
public void setClassName(java.lang.String JavaDoc value) {
59         _ClassName = value;
60     }
61
62     public java.lang.String JavaDoc getClassName() {
63         return _ClassName;
64     }
65
66     public void writeNode(java.io.Writer JavaDoc out) throws java.io.IOException JavaDoc {
67         String JavaDoc myName;
68         myName = "NewCustomizer";
69         writeNode(out, myName, ""); // NOI18N
70
}
71
72     public void writeNode(java.io.Writer JavaDoc out, String JavaDoc nodeName, String JavaDoc indent) throws java.io.IOException JavaDoc {
73         writeNode(out, nodeName, null, indent, new java.util.HashMap JavaDoc());
74     }
75
76     /**
77      * It's not recommended to call this method directly.
78      */

79     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 {
80         out.write(indent);
81         out.write("<");
82         if (namespace != null) {
83             out.write((String JavaDoc)namespaceMap.get(namespace));
84             out.write(":");
85         }
86         out.write(nodeName);
87         writeNodeAttributes(out, nodeName, namespace, indent, namespaceMap);
88         writeNodeChildren(out, nodeName, namespace, indent, namespaceMap);
89         out.write("/>\n");
90     }
91
92     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 {
93         // className is an attribute with namespace http://xml.netbeans.org/schema/wsdlui/property
94
if (_ClassName != null) {
95             out.write(" className='");
96             org.netbeans.modules.xml.wsdl.ui.property.model.ElementProperties.writeXML(out, _ClassName, true);
97             out.write("'"); // NOI18N
98
}
99     }
100
101     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 {
102     }
103
104     public void readNode(org.w3c.dom.Node JavaDoc node) {
105         readNode(node, new java.util.HashMap JavaDoc());
106     }
107
108     public void readNode(org.w3c.dom.Node JavaDoc node, java.util.Map JavaDoc namespacePrefixes) {
109         if (node.hasAttributes()) {
110             org.w3c.dom.NamedNodeMap JavaDoc attrs = node.getAttributes();
111             org.w3c.dom.Attr JavaDoc attr;
112             java.lang.String JavaDoc attrValue;
113             boolean firstNamespaceDef = true;
114             for (int attrNum = 0; attrNum < attrs.getLength(); ++attrNum) {
115                 attr = (org.w3c.dom.Attr JavaDoc) attrs.item(attrNum);
116                 String JavaDoc attrName = attr.getName();
117                 if (attrName.startsWith("xmlns:")) {
118                     if (firstNamespaceDef) {
119                         firstNamespaceDef = false;
120                         // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries.
121
namespacePrefixes = new java.util.HashMap JavaDoc(namespacePrefixes);
122                     }
123                     String JavaDoc attrNSPrefix = attrName.substring(6, attrName.length());
124                     namespacePrefixes.put(attrNSPrefix, attr.getValue());
125                 }
126             }
127             readNodeAttributes(node, namespacePrefixes, attrs);
128         }
129         readNodeChildren(node, namespacePrefixes);
130     }
131
132     protected void readNodeAttributes(org.w3c.dom.Node JavaDoc node, java.util.Map JavaDoc namespacePrefixes, org.w3c.dom.NamedNodeMap JavaDoc attrs) {
133         org.w3c.dom.Attr JavaDoc attr;
134         java.lang.String JavaDoc attrValue;
135         attr = (org.w3c.dom.Attr JavaDoc) attrs.getNamedItem("className");
136         if (attr != null) {
137             attrValue = attr.getValue();
138             _ClassName = attrValue;
139         }
140     }
141
142     protected void readNodeChildren(org.w3c.dom.Node JavaDoc node, java.util.Map JavaDoc namespacePrefixes) {
143     }
144
145     public void changePropertyByName(String JavaDoc name, Object JavaDoc value) {
146         if (name == null) return;
147         name = name.intern();
148         if (name == "className")
149             setClassName((java.lang.String JavaDoc)value);
150         else
151             throw new IllegalArgumentException JavaDoc(name+" is not a valid property name for NewCustomizer");
152     }
153
154     public Object JavaDoc fetchPropertyByName(String JavaDoc name) {
155         if (name == "className")
156             return getClassName();
157         throw new IllegalArgumentException JavaDoc(name+" is not a valid property name for NewCustomizer");
158     }
159
160     public String JavaDoc nameSelf() {
161         return "NewCustomizer";
162     }
163
164     public String JavaDoc nameChild(Object JavaDoc childObj) {
165         return nameChild(childObj, false, false);
166     }
167
168     /**
169      * @param childObj The child object to search for
170      * @param returnSchemaName Whether or not the schema name should be returned or the property name
171      * @return null if not found
172      */

173     public String JavaDoc nameChild(Object JavaDoc childObj, boolean returnConstName, boolean returnSchemaName) {
174         return nameChild(childObj, returnConstName, returnSchemaName, false);
175     }
176
177     /**
178      * @param childObj The child object to search for
179      * @param returnSchemaName Whether or not the schema name should be returned or the property name
180      * @return null if not found
181      */

182     public String JavaDoc nameChild(Object JavaDoc childObj, boolean returnConstName, boolean returnSchemaName, boolean returnXPathName) {
183         if (childObj instanceof java.lang.String JavaDoc) {
184             java.lang.String JavaDoc child = (java.lang.String JavaDoc) childObj;
185             if (child == _ClassName) {
186                 if (returnConstName) {
187                     return CLASSNAME;
188                 } else if (returnSchemaName) {
189                     return "className";
190                 } else if (returnXPathName) {
191                     return "@className";
192                 } else {
193                     return "ClassName";
194                 }
195             }
196         }
197         return null;
198     }
199
200     /**
201      * Return an array of all of the properties that are beans and are set.
202      */

203     public java.lang.Object JavaDoc[] childBeans(boolean recursive) {
204         java.util.List JavaDoc children = new java.util.LinkedList JavaDoc();
205         childBeans(recursive, children);
206         java.lang.Object JavaDoc[] result = new java.lang.Object JavaDoc[children.size()];
207         return (java.lang.Object JavaDoc[]) children.toArray(result);
208     }
209
210     /**
211      * Put all child beans into the beans list.
212      */

213     public void childBeans(boolean recursive, java.util.List JavaDoc beans) {
214     }
215
216     public boolean equals(Object JavaDoc o) {
217         return o instanceof org.netbeans.modules.xml.wsdl.ui.property.model.NewCustomizer && equals((org.netbeans.modules.xml.wsdl.ui.property.model.NewCustomizer) o);
218     }
219
220     public boolean equals(org.netbeans.modules.xml.wsdl.ui.property.model.NewCustomizer inst) {
221         if (inst == this) {
222             return true;
223         }
224         if (inst == null) {
225             return false;
226         }
227         if (!(_ClassName == null ? inst._ClassName == null : _ClassName.equals(inst._ClassName))) {
228             return false;
229         }
230         return true;
231     }
232
233     public int hashCode() {
234         int result = 17;
235         result = 37*result + (_ClassName == null ? 0 : _ClassName.hashCode());
236         return result;
237     }
238
239 }
240
241
242 /*
243         The following schema file has been used for generation:
244
245 <?xml version="1.0" encoding="UTF-8"?>
246
247 <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
248             targetNamespace="http://xml.netbeans.org/schema/wsdlui/property"
249             xmlns:tns="http://xml.netbeans.org/schema/wsdlui/property"
250             elementFormDefault="qualified">
251     <xsd:element name="ElementProperties">
252         <xsd:complexType>
253             <xsd:sequence>
254                 <xsd:element ref="tns:PropertyGroup" maxOccurs="unbounded" />
255                 <xsd:element ref="tns:Property" maxOccurs="unbounded" />
256             </xsd:sequence>
257         </xsd:complexType>
258     </xsd:element>
259     
260     <xsd:element name="PropertyGroup">
261         <xsd:complexType>
262             <xsd:attribute name="name" type="xsd:string" use="required"/>
263             <xsd:attribute name="groupOrder" type="xsd:int"/>
264         </xsd:complexType>
265     </xsd:element>
266     <xsd:element name="Property">
267         <xsd:complexType>
268             <xsd:choice>
269                 <xsd:element name="SchemaCustomizer">
270                 </xsd:element>
271                 <xsd:element name="BuiltInCustomizer">
272                     <xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema">
273                         <xsd:choice>
274                             <xsd:element name="DependsOnCustomizer">
275                                 <xsd:complexType>
276                                     <xsd:choice>
277                                         <xsd:element name="StaticCustomizer">
278                                             <xsd:complexType>
279                                                 <xsd:attribute name="dependsOnAttributeName" type="xsd:QName"/>
280                                             </xsd:complexType>
281                                         </xsd:element>
282                                         <xsd:element name="DynamicCustomizer">
283                                             <xsd:complexType>
284                                                 <xsd:attribute name="dependsOnAttributeValueType" type="xsd:string"/>
285                                                 <xsd:attribute name="attributeValueProviderClass" type="xsd:string"/>
286                                             </xsd:complexType>
287                                         </xsd:element>
288                                     </xsd:choice>
289                                     <xsd:attribute name="name" type="tns:builtInCustomizerTypes"/>
290                                 </xsd:complexType>
291                             </xsd:element>
292                             <xsd:element name="SimpleCustomizer">
293                                 <xsd:complexType xmlns:xsd="http://www.w3.org/2001/XMLSchema">
294                                     <xsd:sequence/>
295                                     <xsd:attribute name="name" type="tns:builtInCustomizerTypes"/>
296                                 </xsd:complexType>
297                             </xsd:element>
298                         </xsd:choice>
299                     </xsd:complexType>
300                 </xsd:element>
301                 <xsd:element ref="tns:NewCustomizer"/>
302             </xsd:choice>
303             <xsd:attribute name="attributeName" type="xsd:string" use="required"/>
304             <xsd:attribute name="groupName" type="xsd:string"/>
305             <xsd:attribute name="propertyOrder" type="xsd:int"/>
306         </xsd:complexType>
307     </xsd:element>
308     <xsd:element name="GroupedProperty">
309         <xsd:complexType>
310             <xsd:choice>
311                 <xsd:element name="BuiltInCustomizer">
312                     <xsd:complexType>
313                         <xsd:attribute name="name" type="tns:GroupedAttributeBuiltInCustomizerTypes"/>
314                         <xsd:attribute name="attributeValueSetterClass" type="xsd:string"/>
315                     </xsd:complexType>
316                 </xsd:element>
317                 <xsd:element ref="tns:NewCustomizer"/>
318             </xsd:choice>
319             <xsd:attribute name="groupedAttributeNames" type="tns:attributeList"/>
320             <xsd:attribute name="groupName" type="xsd:string"/>
321             <xsd:attribute name="propertyOrder" type="xsd:int"/>
322             <xsd:attribute name="groupDisplayName" type="xsd:string"/>
323         </xsd:complexType>
324     </xsd:element>
325     
326     <xsd:element name="NewCustomizer">
327         <xsd:complexType>
328             <xsd:attribute name="className" type="xsd:string"/>
329         </xsd:complexType>
330     </xsd:element>
331                 
332     <xsd:simpleType name="builtInCustomizerTypes">
333         <xsd:restriction base="xsd:string">
334                         <xsd:enumeration value="MessageChooser"/>
335             <xsd:enumeration value="PartChooser"/>
336         </xsd:restriction>
337     </xsd:simpleType>
338     
339     <xsd:simpleType name="GroupedAttributeBuiltInCustomizerTypes">
340         <xsd:restriction base="xsd:string">
341                         <xsd:enumeration value="ElementOrTypeChooser"/>
342         </xsd:restriction>
343     </xsd:simpleType>
344     
345     
346     <xsd:simpleType name="attributeList">
347         <xsd:list itemType="xsd:QName"/>
348     </xsd:simpleType>
349         
350 </xsd:schema>
351
352 */

353
Popular Tags