KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > schema2beansdev > metadd > MetaElement


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  * Code is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

19 /**
20  * This generated bean class MetaElement
21  * matches the schema element 'meta-element'.
22  * The root bean class is MetaDD
23  *
24  * @Generated
25  */

26
27 package org.netbeans.modules.schema2beansdev.metadd;
28
29 public class MetaElement implements org.netbeans.modules.schema2beansdev.metadd.CommonBean {
30     public static final String JavaDoc DTD_NAME = "DtdName"; // NOI18N
31
public static final String JavaDoc NAMESPACE = "Namespace"; // NOI18N
32
public static final String JavaDoc BEAN_NAME = "BeanName"; // NOI18N
33
public static final String JavaDoc BEAN_CLASS = "BeanClass"; // NOI18N
34
public static final String JavaDoc WRAPPER_CLASS = "WrapperClass"; // NOI18N
35
public static final String JavaDoc DEFAULT_VALUE = "DefaultValue"; // NOI18N
36
public static final String JavaDoc KNOWN_VALUE = "KnownValue"; // NOI18N
37
public static final String JavaDoc META_PROPERTY = "MetaProperty"; // NOI18N
38
public static final String JavaDoc COMPARATOR_CLASS = "ComparatorClass"; // NOI18N
39
public static final String JavaDoc IMPLEMENTS = "Implements"; // NOI18N
40
public static final String JavaDoc EXTENDS = "Extends"; // NOI18N
41
public static final String JavaDoc IMPORT = "Import"; // NOI18N
42
public static final String JavaDoc USER_CODE = "UserCode"; // NOI18N
43
public static final String JavaDoc VETOABLE = "Vetoable"; // NOI18N
44
public static final String JavaDoc SKIP_GENERATION = "SkipGeneration"; // NOI18N
45
public static final String JavaDoc DELEGATOR_NAME = "DelegatorName"; // NOI18N
46
public static final String JavaDoc DELEGATOR_EXTENDS = "DelegatorExtends"; // NOI18N
47
public static final String JavaDoc BEAN_INTERFACE_EXTENDS = "BeanInterfaceExtends"; // NOI18N
48
public static final String JavaDoc CAN_BE_EMPTY = "CanBeEmpty"; // NOI18N
49

50     private String JavaDoc _DtdName;
51     private String JavaDoc _Namespace;
52     private String JavaDoc _BeanName;
53     private String JavaDoc _BeanClass;
54     private String JavaDoc _WrapperClass;
55     private java.util.List JavaDoc _DefaultValue = new java.util.ArrayList JavaDoc(); // List<String>
56
private java.util.List JavaDoc _KnownValue = new java.util.ArrayList JavaDoc(); // List<String>
57
private java.util.List JavaDoc _MetaProperty = new java.util.ArrayList JavaDoc(); // List<MetaProperty>
58
private java.util.List JavaDoc _ComparatorClass = new java.util.ArrayList JavaDoc(); // List<String>
59
private String JavaDoc _Implements;
60     private String JavaDoc _Extends;
61     private java.util.List JavaDoc _Import = new java.util.ArrayList JavaDoc(); // List<String>
62
private String JavaDoc _UserCode;
63     private boolean _Vetoable;
64     private boolean _isSet_Vetoable = false;
65     private boolean _SkipGeneration;
66     private boolean _isSet_SkipGeneration = false;
67     private String JavaDoc _DelegatorName;
68     private String JavaDoc _DelegatorExtends;
69     private String JavaDoc _BeanInterfaceExtends;
70     private boolean _CanBeEmpty;
71     private boolean _isSet_CanBeEmpty = false;
72
73     /**
74      * Normal starting point constructor.
75      */

76     public MetaElement() {
77         _DtdName = "";
78     }
79
80     /**
81      * Required parameters constructor
82      */

83     public MetaElement(String JavaDoc dtdName) {
84         _DtdName = dtdName;
85     }
86
87     /**
88      * Deep copy
89      */

90     public MetaElement(org.netbeans.modules.schema2beansdev.metadd.MetaElement source) {
91         this(source, false);
92     }
93
94     /**
95      * Deep copy
96      * @param justData just copy the XML relevant data
97      */

98     public MetaElement(org.netbeans.modules.schema2beansdev.metadd.MetaElement source, boolean justData) {
99         _DtdName = source._DtdName;
100         _Namespace = source._Namespace;
101         _BeanName = source._BeanName;
102         _BeanClass = source._BeanClass;
103         _WrapperClass = source._WrapperClass;
104         for (java.util.Iterator JavaDoc it = source._DefaultValue.iterator();
105             it.hasNext(); ) {
106             String JavaDoc srcElement = (String JavaDoc)it.next();
107             _DefaultValue.add(srcElement);
108         }
109         for (java.util.Iterator JavaDoc it = source._KnownValue.iterator();
110             it.hasNext(); ) {
111             String JavaDoc srcElement = (String JavaDoc)it.next();
112             _KnownValue.add(srcElement);
113         }
114         for (java.util.Iterator JavaDoc it = source._MetaProperty.iterator();
115             it.hasNext(); ) {
116             org.netbeans.modules.schema2beansdev.metadd.MetaProperty srcElement = (org.netbeans.modules.schema2beansdev.metadd.MetaProperty)it.next();
117             _MetaProperty.add((srcElement == null) ? null : newMetaProperty(srcElement, justData));
118         }
119         for (java.util.Iterator JavaDoc it = source._ComparatorClass.iterator();
120             it.hasNext(); ) {
121             String JavaDoc srcElement = (String JavaDoc)it.next();
122             _ComparatorClass.add(srcElement);
123         }
124         _Implements = source._Implements;
125         _Extends = source._Extends;
126         for (java.util.Iterator JavaDoc it = source._Import.iterator();
127             it.hasNext(); ) {
128             String JavaDoc srcElement = (String JavaDoc)it.next();
129             _Import.add(srcElement);
130         }
131         _UserCode = source._UserCode;
132         _Vetoable = source._Vetoable;
133         _isSet_Vetoable = source._isSet_Vetoable;
134         _SkipGeneration = source._SkipGeneration;
135         _isSet_SkipGeneration = source._isSet_SkipGeneration;
136         _DelegatorName = source._DelegatorName;
137         _DelegatorExtends = source._DelegatorExtends;
138         _BeanInterfaceExtends = source._BeanInterfaceExtends;
139         _CanBeEmpty = source._CanBeEmpty;
140         _isSet_CanBeEmpty = source._isSet_CanBeEmpty;
141     }
142
143     // This attribute is mandatory
144
public void setDtdName(String JavaDoc value) {
145         _DtdName = value;
146     }
147
148     public String JavaDoc getDtdName() {
149         return _DtdName;
150     }
151
152     // This attribute is optional
153
public void setNamespace(String JavaDoc value) {
154         _Namespace = value;
155     }
156
157     public String JavaDoc getNamespace() {
158         return _Namespace;
159     }
160
161     // This attribute is optional
162
public void setBeanName(String JavaDoc value) {
163         _BeanName = value;
164     }
165
166     public String JavaDoc getBeanName() {
167         return _BeanName;
168     }
169
170     // This attribute is optional
171
public void setBeanClass(String JavaDoc value) {
172         _BeanClass = value;
173     }
174
175     public String JavaDoc getBeanClass() {
176         return _BeanClass;
177     }
178
179     // This attribute is optional
180
public void setWrapperClass(String JavaDoc value) {
181         _WrapperClass = value;
182     }
183
184     public String JavaDoc getWrapperClass() {
185         return _WrapperClass;
186     }
187
188     // This attribute is an array, possibly empty
189
public void setDefaultValue(String JavaDoc[] value) {
190         if (value == null)
191             value = new String JavaDoc[0];
192         _DefaultValue.clear();
193         ((java.util.ArrayList JavaDoc) _DefaultValue).ensureCapacity(value.length);
194         for (int i = 0; i < value.length; ++i) {
195             _DefaultValue.add(value[i]);
196         }
197     }
198
199     public void setDefaultValue(int index, String JavaDoc value) {
200         _DefaultValue.set(index, value);
201     }
202
203     public String JavaDoc[] getDefaultValue() {
204         String JavaDoc[] arr = new String JavaDoc[_DefaultValue.size()];
205         return (String JavaDoc[]) _DefaultValue.toArray(arr);
206     }
207
208     public java.util.List JavaDoc fetchDefaultValueList() {
209         return _DefaultValue;
210     }
211
212     public String JavaDoc getDefaultValue(int index) {
213         return (String JavaDoc)_DefaultValue.get(index);
214     }
215
216     // Return the number of defaultValue
217
public int sizeDefaultValue() {
218         return _DefaultValue.size();
219     }
220
221     public int addDefaultValue(String JavaDoc value) {
222         _DefaultValue.add(value);
223         int positionOfNewItem = _DefaultValue.size()-1;
224         return positionOfNewItem;
225     }
226
227     /**
228      * Search from the end looking for @param value, and then remove it.
229      */

230     public int removeDefaultValue(String JavaDoc value) {
231         int pos = _DefaultValue.indexOf(value);
232         if (pos >= 0) {
233             _DefaultValue.remove(pos);
234         }
235         return pos;
236     }
237
238     // This attribute is an array, possibly empty
239
public void setKnownValue(String JavaDoc[] value) {
240         if (value == null)
241             value = new String JavaDoc[0];
242         _KnownValue.clear();
243         ((java.util.ArrayList JavaDoc) _KnownValue).ensureCapacity(value.length);
244         for (int i = 0; i < value.length; ++i) {
245             _KnownValue.add(value[i]);
246         }
247     }
248
249     public void setKnownValue(int index, String JavaDoc value) {
250         _KnownValue.set(index, value);
251     }
252
253     public String JavaDoc[] getKnownValue() {
254         String JavaDoc[] arr = new String JavaDoc[_KnownValue.size()];
255         return (String JavaDoc[]) _KnownValue.toArray(arr);
256     }
257
258     public java.util.List JavaDoc fetchKnownValueList() {
259         return _KnownValue;
260     }
261
262     public String JavaDoc getKnownValue(int index) {
263         return (String JavaDoc)_KnownValue.get(index);
264     }
265
266     // Return the number of knownValue
267
public int sizeKnownValue() {
268         return _KnownValue.size();
269     }
270
271     public int addKnownValue(String JavaDoc value) {
272         _KnownValue.add(value);
273         int positionOfNewItem = _KnownValue.size()-1;
274         return positionOfNewItem;
275     }
276
277     /**
278      * Search from the end looking for @param value, and then remove it.
279      */

280     public int removeKnownValue(String JavaDoc value) {
281         int pos = _KnownValue.indexOf(value);
282         if (pos >= 0) {
283             _KnownValue.remove(pos);
284         }
285         return pos;
286     }
287
288     // This attribute is an array, possibly empty
289
public void setMetaProperty(org.netbeans.modules.schema2beansdev.metadd.MetaProperty[] value) {
290         if (value == null)
291             value = new MetaProperty[0];
292         _MetaProperty.clear();
293         ((java.util.ArrayList JavaDoc) _MetaProperty).ensureCapacity(value.length);
294         for (int i = 0; i < value.length; ++i) {
295             _MetaProperty.add(value[i]);
296         }
297     }
298
299     public void setMetaProperty(int index, org.netbeans.modules.schema2beansdev.metadd.MetaProperty value) {
300         _MetaProperty.set(index, value);
301     }
302
303     public org.netbeans.modules.schema2beansdev.metadd.MetaProperty[] getMetaProperty() {
304         MetaProperty[] arr = new MetaProperty[_MetaProperty.size()];
305         return (MetaProperty[]) _MetaProperty.toArray(arr);
306     }
307
308     public java.util.List JavaDoc fetchMetaPropertyList() {
309         return _MetaProperty;
310     }
311
312     public org.netbeans.modules.schema2beansdev.metadd.MetaProperty getMetaProperty(int index) {
313         return (MetaProperty)_MetaProperty.get(index);
314     }
315
316     // Return the number of metaProperty
317
public int sizeMetaProperty() {
318         return _MetaProperty.size();
319     }
320
321     public int addMetaProperty(org.netbeans.modules.schema2beansdev.metadd.MetaProperty value) {
322         _MetaProperty.add(value);
323         int positionOfNewItem = _MetaProperty.size()-1;
324         return positionOfNewItem;
325     }
326
327     /**
328      * Search from the end looking for @param value, and then remove it.
329      */

330     public int removeMetaProperty(org.netbeans.modules.schema2beansdev.metadd.MetaProperty value) {
331         int pos = _MetaProperty.indexOf(value);
332         if (pos >= 0) {
333             _MetaProperty.remove(pos);
334         }
335         return pos;
336     }
337
338     // This attribute is an array, possibly empty
339
public void setComparatorClass(String JavaDoc[] value) {
340         if (value == null)
341             value = new String JavaDoc[0];
342         _ComparatorClass.clear();
343         ((java.util.ArrayList JavaDoc) _ComparatorClass).ensureCapacity(value.length);
344         for (int i = 0; i < value.length; ++i) {
345             _ComparatorClass.add(value[i]);
346         }
347     }
348
349     public void setComparatorClass(int index, String JavaDoc value) {
350         _ComparatorClass.set(index, value);
351     }
352
353     public String JavaDoc[] getComparatorClass() {
354         String JavaDoc[] arr = new String JavaDoc[_ComparatorClass.size()];
355         return (String JavaDoc[]) _ComparatorClass.toArray(arr);
356     }
357
358     public java.util.List JavaDoc fetchComparatorClassList() {
359         return _ComparatorClass;
360     }
361
362     public String JavaDoc getComparatorClass(int index) {
363         return (String JavaDoc)_ComparatorClass.get(index);
364     }
365
366     // Return the number of comparatorClass
367
public int sizeComparatorClass() {
368         return _ComparatorClass.size();
369     }
370
371     public int addComparatorClass(String JavaDoc value) {
372         _ComparatorClass.add(value);
373         int positionOfNewItem = _ComparatorClass.size()-1;
374         return positionOfNewItem;
375     }
376
377     /**
378      * Search from the end looking for @param value, and then remove it.
379      */

380     public int removeComparatorClass(String JavaDoc value) {
381         int pos = _ComparatorClass.indexOf(value);
382         if (pos >= 0) {
383             _ComparatorClass.remove(pos);
384         }
385         return pos;
386     }
387
388     // This attribute is optional
389
public void setImplements(String JavaDoc value) {
390         _Implements = value;
391     }
392
393     public String JavaDoc getImplements() {
394         return _Implements;
395     }
396
397     // This attribute is optional
398
public void setExtends(String JavaDoc value) {
399         _Extends = value;
400     }
401
402     public String JavaDoc getExtends() {
403         return _Extends;
404     }
405
406     // This attribute is an array, possibly empty
407
public void setImport(String JavaDoc[] value) {
408         if (value == null)
409             value = new String JavaDoc[0];
410         _Import.clear();
411         ((java.util.ArrayList JavaDoc) _Import).ensureCapacity(value.length);
412         for (int i = 0; i < value.length; ++i) {
413             _Import.add(value[i]);
414         }
415     }
416
417     public void setImport(int index, String JavaDoc value) {
418         _Import.set(index, value);
419     }
420
421     public String JavaDoc[] getImport() {
422         String JavaDoc[] arr = new String JavaDoc[_Import.size()];
423         return (String JavaDoc[]) _Import.toArray(arr);
424     }
425
426     public java.util.List JavaDoc fetchImportList() {
427         return _Import;
428     }
429
430     public String JavaDoc getImport(int index) {
431         return (String JavaDoc)_Import.get(index);
432     }
433
434     // Return the number of import
435
public int sizeImport() {
436         return _Import.size();
437     }
438
439     public int addImport(String JavaDoc value) {
440         _Import.add(value);
441         int positionOfNewItem = _Import.size()-1;
442         return positionOfNewItem;
443     }
444
445     /**
446      * Search from the end looking for @param value, and then remove it.
447      */

448     public int removeImport(String JavaDoc value) {
449         int pos = _Import.indexOf(value);
450         if (pos >= 0) {
451             _Import.remove(pos);
452         }
453         return pos;
454     }
455
456     // This attribute is optional
457
public void setUserCode(String JavaDoc value) {
458         _UserCode = value;
459     }
460
461     public String JavaDoc getUserCode() {
462         return _UserCode;
463     }
464
465     // This attribute is optional
466
public void setVetoable(boolean value) {
467         _Vetoable = value;
468         _isSet_Vetoable = true;
469     }
470
471     public boolean isVetoable() {
472         return _Vetoable;
473     }
474
475     // This attribute is optional
476
public void setSkipGeneration(boolean value) {
477         _SkipGeneration = value;
478         _isSet_SkipGeneration = true;
479     }
480
481     public boolean isSkipGeneration() {
482         return _SkipGeneration;
483     }
484
485     // This attribute is optional
486
public void setDelegatorName(String JavaDoc value) {
487         _DelegatorName = value;
488     }
489
490     public String JavaDoc getDelegatorName() {
491         return _DelegatorName;
492     }
493
494     // This attribute is optional
495
public void setDelegatorExtends(String JavaDoc value) {
496         _DelegatorExtends = value;
497     }
498
499     public String JavaDoc getDelegatorExtends() {
500         return _DelegatorExtends;
501     }
502
503     // This attribute is optional
504
public void setBeanInterfaceExtends(String JavaDoc value) {
505         _BeanInterfaceExtends = value;
506     }
507
508     public String JavaDoc getBeanInterfaceExtends() {
509         return _BeanInterfaceExtends;
510     }
511
512     // This attribute is optional
513
public void setCanBeEmpty(boolean value) {
514         _CanBeEmpty = value;
515         _isSet_CanBeEmpty = true;
516     }
517
518     public boolean isCanBeEmpty() {
519         return _CanBeEmpty;
520     }
521
522     /**
523      * Create a new bean using it's default constructor.
524      * This does not add it to any bean graph.
525      */

526     public org.netbeans.modules.schema2beansdev.metadd.MetaProperty newMetaProperty() {
527         return new org.netbeans.modules.schema2beansdev.metadd.MetaProperty();
528     }
529
530     /**
531      * Create a new bean, copying from another one.
532      * This does not add it to any bean graph.
533      */

534     public org.netbeans.modules.schema2beansdev.metadd.MetaProperty newMetaProperty(MetaProperty source, boolean justData) {
535         return new org.netbeans.modules.schema2beansdev.metadd.MetaProperty(source, justData);
536     }
537
538     public void writeNode(java.io.Writer JavaDoc out) throws java.io.IOException JavaDoc {
539         String JavaDoc myName;
540         myName = "meta-element";
541         writeNode(out, myName, ""); // NOI18N
542
}
543
544     public void writeNode(java.io.Writer JavaDoc out, String JavaDoc nodeName, String JavaDoc indent) throws java.io.IOException JavaDoc {
545         writeNode(out, nodeName, null, indent, new java.util.HashMap JavaDoc());
546     }
547
548     /**
549      * It's not recommended to call this method directly.
550      */

551     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 {
552         out.write(indent);
553         out.write("<");
554         if (namespace != null) {
555             out.write((String JavaDoc)namespaceMap.get(namespace));
556             out.write(":");
557         }
558         out.write(nodeName);
559         out.write(">\n");
560         String JavaDoc nextIndent = indent + " ";
561         if (_DtdName != null) {
562             out.write(nextIndent);
563             out.write("<dtd-name"); // NOI18N
564
out.write(">"); // NOI18N
565
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, _DtdName, false);
566             out.write("</dtd-name>\n"); // NOI18N
567
}
568         if (_Namespace != null) {
569             out.write(nextIndent);
570             out.write("<namespace"); // NOI18N
571
out.write(">"); // NOI18N
572
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, _Namespace, false);
573             out.write("</namespace>\n"); // NOI18N
574
}
575         if (_BeanName != null) {
576             out.write(nextIndent);
577             out.write("<bean-name"); // NOI18N
578
out.write(">"); // NOI18N
579
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, _BeanName, false);
580             out.write("</bean-name>\n"); // NOI18N
581
}
582         if (_BeanClass != null) {
583             out.write(nextIndent);
584             out.write("<bean-class"); // NOI18N
585
out.write(">"); // NOI18N
586
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, _BeanClass, false);
587             out.write("</bean-class>\n"); // NOI18N
588
}
589         if (_WrapperClass != null) {
590             out.write(nextIndent);
591             out.write("<wrapper-class"); // NOI18N
592
out.write(">"); // NOI18N
593
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, _WrapperClass, false);
594             out.write("</wrapper-class>\n"); // NOI18N
595
}
596         for (java.util.Iterator JavaDoc it = _DefaultValue.iterator();
597             it.hasNext(); ) {
598             String JavaDoc element = (String JavaDoc)it.next();
599             if (element != null) {
600                 out.write(nextIndent);
601                 out.write("<default-value"); // NOI18N
602
out.write(">"); // NOI18N
603
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, element, false);
604                 out.write("</default-value>\n"); // NOI18N
605
}
606         }
607         for (java.util.Iterator JavaDoc it = _KnownValue.iterator(); it.hasNext();
608             ) {
609             String JavaDoc element = (String JavaDoc)it.next();
610             if (element != null) {
611                 out.write(nextIndent);
612                 out.write("<known-value"); // NOI18N
613
out.write(">"); // NOI18N
614
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, element, false);
615                 out.write("</known-value>\n"); // NOI18N
616
}
617         }
618         for (java.util.Iterator JavaDoc it = _MetaProperty.iterator();
619             it.hasNext(); ) {
620             org.netbeans.modules.schema2beansdev.metadd.MetaProperty element = (org.netbeans.modules.schema2beansdev.metadd.MetaProperty)it.next();
621             if (element != null) {
622                 element.writeNode(out, "meta-property", null, nextIndent, namespaceMap);
623             }
624         }
625         for (java.util.Iterator JavaDoc it = _ComparatorClass.iterator();
626             it.hasNext(); ) {
627             String JavaDoc element = (String JavaDoc)it.next();
628             if (element != null) {
629                 out.write(nextIndent);
630                 out.write("<comparator-class"); // NOI18N
631
out.write(">"); // NOI18N
632
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, element, false);
633                 out.write("</comparator-class>\n"); // NOI18N
634
}
635         }
636         if (_Implements != null) {
637             out.write(nextIndent);
638             out.write("<implements"); // NOI18N
639
out.write(">"); // NOI18N
640
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, _Implements, false);
641             out.write("</implements>\n"); // NOI18N
642
}
643         if (_Extends != null) {
644             out.write(nextIndent);
645             out.write("<extends"); // NOI18N
646
out.write(">"); // NOI18N
647
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, _Extends, false);
648             out.write("</extends>\n"); // NOI18N
649
}
650         for (java.util.Iterator JavaDoc it = _Import.iterator(); it.hasNext(); ) {
651             String JavaDoc element = (String JavaDoc)it.next();
652             if (element != null) {
653                 out.write(nextIndent);
654                 out.write("<import"); // NOI18N
655
out.write(">"); // NOI18N
656
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, element, false);
657                 out.write("</import>\n"); // NOI18N
658
}
659         }
660         if (_UserCode != null) {
661             out.write(nextIndent);
662             out.write("<user-code"); // NOI18N
663
out.write(">"); // NOI18N
664
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, _UserCode, false);
665             out.write("</user-code>\n"); // NOI18N
666
}
667         if (_isSet_Vetoable) {
668             if (_Vetoable) {
669                 out.write(nextIndent);
670                 out.write("<vetoable"); // NOI18N
671
out.write("/>\n"); // NOI18N
672
}
673         }
674         if (_isSet_SkipGeneration) {
675             if (_SkipGeneration) {
676                 out.write(nextIndent);
677                 out.write("<skip-generation"); // NOI18N
678
out.write("/>\n"); // NOI18N
679
}
680         }
681         if (_DelegatorName != null) {
682             out.write(nextIndent);
683             out.write("<delegator-name"); // NOI18N
684
out.write(">"); // NOI18N
685
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, _DelegatorName, false);
686             out.write("</delegator-name>\n"); // NOI18N
687
}
688         if (_DelegatorExtends != null) {
689             out.write(nextIndent);
690             out.write("<delegator-extends"); // NOI18N
691
out.write(">"); // NOI18N
692
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, _DelegatorExtends, false);
693             out.write("</delegator-extends>\n"); // NOI18N
694
}
695         if (_BeanInterfaceExtends != null) {
696             out.write(nextIndent);
697             out.write("<bean-interface-extends"); // NOI18N
698
out.write(">"); // NOI18N
699
org.netbeans.modules.schema2beansdev.metadd.MetaDD.writeXML(out, _BeanInterfaceExtends, false);
700             out.write("</bean-interface-extends>\n"); // NOI18N
701
}
702         if (_isSet_CanBeEmpty) {
703             if (_CanBeEmpty) {
704                 out.write(nextIndent);
705                 out.write("<can-be-empty"); // NOI18N
706
out.write("/>\n"); // NOI18N
707
}
708         }
709         out.write(indent);
710         out.write("</");
711         if (namespace != null) {
712             out.write((String JavaDoc)namespaceMap.get(namespace));
713             out.write(":");
714         }
715         out.write(nodeName);
716         out.write(">\n");
717     }
718
719     public void readNode(org.w3c.dom.Node JavaDoc node) {
720         readNode(node, new java.util.HashMap JavaDoc());
721     }
722
723     public void readNode(org.w3c.dom.Node JavaDoc node, java.util.Map JavaDoc namespacePrefixes) {
724         if (node.hasAttributes()) {
725             org.w3c.dom.NamedNodeMap JavaDoc attrs = node.getAttributes();
726             org.w3c.dom.Attr JavaDoc attr;
727             java.lang.String JavaDoc attrValue;
728             boolean firstNamespaceDef = true;
729             for (int attrNum = 0; attrNum < attrs.getLength(); ++attrNum) {
730                 attr = (org.w3c.dom.Attr JavaDoc) attrs.item(attrNum);
731                 String JavaDoc attrName = attr.getName();
732                 if (attrName.startsWith("xmlns:")) {
733                     if (firstNamespaceDef) {
734                         firstNamespaceDef = false;
735                         // Dup prefix map, so as to not write over previous values, and to make it easy to clear out our entries.
736
namespacePrefixes = new java.util.HashMap JavaDoc(namespacePrefixes);
737                     }
738                     String JavaDoc attrNSPrefix = attrName.substring(6, attrName.length());
739                     namespacePrefixes.put(attrNSPrefix, attr.getValue());
740                 }
741             }
742         }
743         org.w3c.dom.NodeList JavaDoc children = node.getChildNodes();
744         for (int i = 0, size = children.getLength(); i < size; ++i) {
745             org.w3c.dom.Node JavaDoc childNode = children.item(i);
746             String JavaDoc childNodeName = (childNode.getLocalName() == null ? childNode.getNodeName().intern() : childNode.getLocalName().intern());
747             String JavaDoc childNodeValue = "";
748             if (childNode.getFirstChild() != null) {
749                 childNodeValue = childNode.getFirstChild().getNodeValue();
750             }
751             if (childNodeName == "dtd-name") {
752                 _DtdName = childNodeValue;
753             }
754             else if (childNodeName == "namespace") {
755                 _Namespace = childNodeValue;
756             }
757             else if (childNodeName == "bean-name") {
758                 _BeanName = childNodeValue;
759             }
760             else if (childNodeName == "bean-class") {
761                 _BeanClass = childNodeValue;
762             }
763             else if (childNodeName == "wrapper-class") {
764                 _WrapperClass = childNodeValue;
765             }
766             else if (childNodeName == "default-value") {
767                 String JavaDoc aDefaultValue;
768                 aDefaultValue = childNodeValue;
769                 _DefaultValue.add(aDefaultValue);
770             }
771             else if (childNodeName == "known-value") {
772                 String JavaDoc aKnownValue;
773                 aKnownValue = childNodeValue;
774                 _KnownValue.add(aKnownValue);
775             }
776             else if (childNodeName == "meta-property") {
777                 MetaProperty aMetaProperty = newMetaProperty();
778                 aMetaProperty.readNode(childNode, namespacePrefixes);
779                 _MetaProperty.add(aMetaProperty);
780             }
781             else if (childNodeName == "comparator-class") {
782                 String JavaDoc aComparatorClass;
783                 aComparatorClass = childNodeValue;
784                 _ComparatorClass.add(aComparatorClass);
785             }
786             else if (childNodeName == "implements") {
787                 _Implements = childNodeValue;
788             }
789             else if (childNodeName == "extends") {
790                 _Extends = childNodeValue;
791             }
792             else if (childNodeName == "import") {
793                 String JavaDoc aImport;
794                 aImport = childNodeValue;
795                 _Import.add(aImport);
796             }
797             else if (childNodeName == "user-code") {
798                 _UserCode = childNodeValue;
799             }
800             else if (childNodeName == "vetoable") {
801                 if (childNode.getFirstChild() == null)
802                     _Vetoable = true;
803                 else
804                     _Vetoable = java.lang.Boolean.valueOf(childNodeValue).booleanValue();
805                 _isSet_Vetoable = true;
806             }
807             else if (childNodeName == "skip-generation") {
808                 if (childNode.getFirstChild() == null)
809                     _SkipGeneration = true;
810                 else
811                     _SkipGeneration = java.lang.Boolean.valueOf(childNodeValue).booleanValue();
812                 _isSet_SkipGeneration = true;
813             }
814             else if (childNodeName == "delegator-name") {
815                 _DelegatorName = childNodeValue;
816             }
817             else if (childNodeName == "delegator-extends") {
818                 _DelegatorExtends = childNodeValue;
819             }
820             else if (childNodeName == "bean-interface-extends") {
821                 _BeanInterfaceExtends = childNodeValue;
822             }
823             else if (childNodeName == "can-be-empty") {
824                 if (childNode.getFirstChild() == null)
825                     _CanBeEmpty = true;
826                 else
827                     _CanBeEmpty = java.lang.Boolean.valueOf(childNodeValue).booleanValue();
828                 _isSet_CanBeEmpty = true;
829             }
830             else {
831                 // Found extra unrecognized childNode
832
}
833         }
834     }
835
836     public void validate() throws org.netbeans.modules.schema2beansdev.metadd.MetaDD.ValidateException {
837         boolean restrictionFailure = false;
838         boolean restrictionPassed = false;
839         // Validating property dtdName
840
if (getDtdName() == null) {
841             throw new org.netbeans.modules.schema2beansdev.metadd.MetaDD.ValidateException("getDtdName() == null", org.netbeans.modules.schema2beansdev.metadd.MetaDD.ValidateException.FailureType.NULL_VALUE, "dtdName", this); // NOI18N
842
}
843         // Validating property namespace
844
// Validating property beanName
845
// Validating property beanClass
846
// Validating property wrapperClass
847
// Validating property defaultValue
848
// Validating property knownValue
849
// Validating property metaProperty
850
for (int _index = 0; _index < sizeMetaProperty(); ++_index) {
851             org.netbeans.modules.schema2beansdev.metadd.MetaProperty element = getMetaProperty(_index);
852             if (element != null) {
853                 element.validate();
854             }
855         }
856         // Validating property comparatorClass
857
// Validating property implements
858
// Validating property extends
859
// Validating property import
860
// Validating property userCode
861
// Validating property vetoable
862
// Validating property skipGeneration
863
// Validating property delegatorName
864
// Validating property delegatorExtends
865
// Validating property beanInterfaceExtends
866
// Validating property canBeEmpty
867
}
868
869     public void changePropertyByName(String JavaDoc name, Object JavaDoc value) {
870         if (name == null) return;
871         name = name.intern();
872         if (name == "dtdName")
873             setDtdName((String JavaDoc)value);
874         else if (name == "namespace")
875             setNamespace((String JavaDoc)value);
876         else if (name == "beanName")
877             setBeanName((String JavaDoc)value);
878         else if (name == "beanClass")
879             setBeanClass((String JavaDoc)value);
880         else if (name == "wrapperClass")
881             setWrapperClass((String JavaDoc)value);
882         else if (name == "defaultValue")
883             addDefaultValue((String JavaDoc)value);
884         else if (name == "defaultValue[]")
885             setDefaultValue((String JavaDoc[]) value);
886         else if (name == "knownValue")
887             addKnownValue((String JavaDoc)value);
888         else if (name == "knownValue[]")
889             setKnownValue((String JavaDoc[]) value);
890         else if (name == "metaProperty")
891             addMetaProperty((MetaProperty)value);
892         else if (name == "metaProperty[]")
893             setMetaProperty((MetaProperty[]) value);
894         else if (name == "comparatorClass")
895             addComparatorClass((String JavaDoc)value);
896         else if (name == "comparatorClass[]")
897             setComparatorClass((String JavaDoc[]) value);
898         else if (name == "implements")
899             setImplements((String JavaDoc)value);
900         else if (name == "extends")
901             setExtends((String JavaDoc)value);
902         else if (name == "import")
903             addImport((String JavaDoc)value);
904         else if (name == "import[]")
905             setImport((String JavaDoc[]) value);
906         else if (name == "userCode")
907             setUserCode((String JavaDoc)value);
908         else if (name == "vetoable")
909             setVetoable(((java.lang.Boolean JavaDoc)value).booleanValue());
910         else if (name == "skipGeneration")
911             setSkipGeneration(((java.lang.Boolean JavaDoc)value).booleanValue());
912         else if (name == "delegatorName")
913             setDelegatorName((String JavaDoc)value);
914         else if (name == "delegatorExtends")
915             setDelegatorExtends((String JavaDoc)value);
916         else if (name == "beanInterfaceExtends")
917             setBeanInterfaceExtends((String JavaDoc)value);
918         else if (name == "canBeEmpty")
919             setCanBeEmpty(((java.lang.Boolean JavaDoc)value).booleanValue());
920         else
921             throw new IllegalArgumentException JavaDoc(name+" is not a valid property name for MetaElement");
922     }
923
924     public Object JavaDoc fetchPropertyByName(String JavaDoc name) {
925         if (name == "dtdName")
926             return getDtdName();
927         if (name == "namespace")
928             return getNamespace();
929         if (name == "beanName")
930             return getBeanName();
931         if (name == "beanClass")
932             return getBeanClass();
933         if (name == "wrapperClass")
934             return getWrapperClass();
935         if (name == "defaultValue[]")
936             return getDefaultValue();
937         if (name == "knownValue[]")
938             return getKnownValue();
939         if (name == "metaProperty[]")
940             return getMetaProperty();
941         if (name == "comparatorClass[]")
942             return getComparatorClass();
943         if (name == "implements")
944             return getImplements();
945         if (name == "extends")
946             return getExtends();
947         if (name == "import[]")
948             return getImport();
949         if (name == "userCode")
950             return getUserCode();
951         if (name == "vetoable")
952             return (isVetoable() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
953         if (name == "skipGeneration")
954             return (isSkipGeneration() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
955         if (name == "delegatorName")
956             return getDelegatorName();
957         if (name == "delegatorExtends")
958             return getDelegatorExtends();
959         if (name == "beanInterfaceExtends")
960             return getBeanInterfaceExtends();
961         if (name == "canBeEmpty")
962             return (isCanBeEmpty() ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE);
963         throw new IllegalArgumentException JavaDoc(name+" is not a valid property name for MetaElement");
964     }
965
966     public String JavaDoc nameSelf() {
967         return "MetaElement";
968     }
969
970     public String JavaDoc nameChild(Object JavaDoc childObj) {
971         return nameChild(childObj, false, false);
972     }
973
974     /**
975      * @param childObj The child object to search for
976      * @param returnSchemaName Whether or not the schema name should be returned or the property name
977      * @return null if not found
978      */

979     public String JavaDoc nameChild(Object JavaDoc childObj, boolean returnConstName, boolean returnSchemaName) {
980         return nameChild(childObj, returnConstName, returnSchemaName, false);
981     }
982
983     /**
984      * @param childObj The child object to search for
985      * @param returnSchemaName Whether or not the schema name should be returned or the property name
986      * @return null if not found
987      */

988     public String JavaDoc nameChild(Object JavaDoc childObj, boolean returnConstName, boolean returnSchemaName, boolean returnXPathName) {
989         if (childObj instanceof java.lang.String JavaDoc) {
990             java.lang.String JavaDoc child = (java.lang.String JavaDoc) childObj;
991             if (child == _DtdName) {
992                 if (returnConstName) {
993                     return DTD_NAME;
994                 } else if (returnSchemaName) {
995                     return "dtd-name";
996                 } else if (returnXPathName) {
997                     return "dtd-name";
998                 } else {
999                     return "DtdName";
1000                }
1001            }
1002            if (child == _Namespace) {
1003                if (returnConstName) {
1004                    return NAMESPACE;
1005                } else if (returnSchemaName) {
1006                    return "namespace";
1007                } else if (returnXPathName) {
1008                    return "namespace";
1009                } else {
1010                    return "Namespace";
1011                }
1012            }
1013            if (child == _BeanName) {
1014                if (returnConstName) {
1015                    return BEAN_NAME;
1016                } else if (returnSchemaName) {
1017                    return "bean-name";
1018                } else if (returnXPathName) {
1019                    return "bean-name";
1020                } else {
1021                    return "BeanName";
1022                }
1023            }
1024            if (child == _BeanClass) {
1025                if (returnConstName) {
1026                    return BEAN_CLASS;
1027                } else if (returnSchemaName) {
1028                    return "bean-class";
1029                } else if (returnXPathName) {
1030                    return "bean-class";
1031                } else {
1032                    return "BeanClass";
1033                }
1034            }
1035            if (child == _WrapperClass) {
1036                if (returnConstName) {
1037                    return WRAPPER_CLASS;
1038                } else if (returnSchemaName) {
1039                    return "wrapper-class";
1040                } else if (returnXPathName) {
1041                    return "wrapper-class";
1042                } else {
1043                    return "WrapperClass";
1044                }
1045            }
1046            int index = 0;
1047            for (java.util.Iterator JavaDoc it = _DefaultValue.iterator();
1048                it.hasNext(); ) {
1049                String JavaDoc element = (String JavaDoc)it.next();
1050                if (child == element) {
1051                    if (returnConstName) {
1052                        return DEFAULT_VALUE;
1053                    } else if (returnSchemaName) {
1054                        return "default-value";
1055                    } else if (returnXPathName) {
1056                        return "default-value[position()="+index+"]";
1057                    } else {
1058                        return "DefaultValue."+Integer.toHexString(index);
1059                    }
1060                }
1061                ++index;
1062            }
1063            index = 0;
1064            for (java.util.Iterator JavaDoc it = _KnownValue.iterator();
1065                it.hasNext(); ) {
1066                String JavaDoc element = (String JavaDoc)it.next();
1067                if (child == element) {
1068                    if (returnConstName) {
1069                        return KNOWN_VALUE;
1070                    } else if (returnSchemaName) {
1071                        return "known-value";
1072                    } else if (returnXPathName) {
1073                        return "known-value[position()="+index+"]";
1074                    } else {
1075                        return "KnownValue."+Integer.toHexString(index);
1076                    }
1077                }
1078                ++index;
1079            }
1080            index = 0;
1081            for (java.util.Iterator JavaDoc it = _ComparatorClass.iterator();
1082                it.hasNext(); ) {
1083                String JavaDoc element = (String JavaDoc)it.next();
1084                if (child == element) {
1085                    if (returnConstName) {
1086                        return COMPARATOR_CLASS;
1087                    } else if (returnSchemaName) {
1088                        return "comparator-class";
1089                    } else if (returnXPathName) {
1090                        return "comparator-class[position()="+index+"]";
1091                    } else {
1092                        return "ComparatorClass."+Integer.toHexString(index);
1093                    }
1094                }
1095                ++index;
1096            }
1097            if (child == _Implements) {
1098                if (returnConstName) {
1099                    return IMPLEMENTS;
1100                } else if (returnSchemaName) {
1101                    return "implements";
1102                } else if (returnXPathName) {
1103                    return "implements";
1104                } else {
1105                    return "Implements";
1106                }
1107            }
1108            if (child == _Extends) {
1109                if (returnConstName) {
1110                    return EXTENDS;
1111                } else if (returnSchemaName) {
1112                    return "extends";
1113                } else if (returnXPathName) {
1114                    return "extends";
1115                } else {
1116                    return "Extends";
1117                }
1118            }
1119            index = 0;
1120            for (java.util.Iterator JavaDoc it = _Import.iterator(); it.hasNext();
1121                ) {
1122                String JavaDoc element = (String JavaDoc)it.next();
1123                if (child == element) {
1124                    if (returnConstName) {
1125                        return IMPORT;
1126                    } else if (returnSchemaName) {
1127                        return "import";
1128                    } else if (returnXPathName) {
1129                        return "import[position()="+index+"]";
1130                    } else {
1131                        return "Import."+Integer.toHexString(index);
1132                    }
1133                }
1134                ++index;
1135            }
1136            if (child == _UserCode) {
1137                if (returnConstName) {
1138                    return USER_CODE;
1139                } else if (returnSchemaName) {
1140                    return "user-code";
1141                } else if (returnXPathName) {
1142                    return "user-code";
1143                } else {
1144                    return "UserCode";
1145                }
1146            }
1147            if (child == _DelegatorName) {
1148                if (returnConstName) {
1149                    return DELEGATOR_NAME;
1150                } else if (returnSchemaName) {
1151                    return "delegator-name";
1152                } else if (returnXPathName) {
1153                    return "delegator-name";
1154                } else {
1155                    return "DelegatorName";
1156                }
1157            }
1158            if (child == _DelegatorExtends) {
1159                if (returnConstName) {
1160                    return DELEGATOR_EXTENDS;
1161                } else if (returnSchemaName) {
1162                    return "delegator-extends";
1163                } else if (returnXPathName) {
1164                    return "delegator-extends";
1165                } else {
1166                    return "DelegatorExtends";
1167                }
1168            }
1169            if (child == _BeanInterfaceExtends) {
1170                if (returnConstName) {
1171                    return BEAN_INTERFACE_EXTENDS;
1172                } else if (returnSchemaName) {
1173                    return "bean-interface-extends";
1174                } else if (returnXPathName) {
1175                    return "bean-interface-extends";
1176                } else {
1177                    return "BeanInterfaceExtends";
1178                }
1179            }
1180        }
1181        if (childObj instanceof MetaProperty) {
1182            MetaProperty child = (MetaProperty) childObj;
1183            int index = 0;
1184            for (java.util.Iterator JavaDoc it = _MetaProperty.iterator();
1185                it.hasNext(); ) {
1186                org.netbeans.modules.schema2beansdev.metadd.MetaProperty element = (org.netbeans.modules.schema2beansdev.metadd.MetaProperty)it.next();
1187                if (child == element) {
1188                    if (returnConstName) {
1189                        return META_PROPERTY;
1190                    } else if (returnSchemaName) {
1191                        return "meta-property";
1192                    } else if (returnXPathName) {
1193                        return "meta-property[position()="+index+"]";
1194                    } else {
1195                        return "MetaProperty."+Integer.toHexString(index);
1196                    }
1197                }
1198                ++index;
1199            }
1200        }
1201        if (childObj instanceof java.lang.Boolean JavaDoc) {
1202            java.lang.Boolean JavaDoc child = (java.lang.Boolean JavaDoc) childObj;
1203            if (((java.lang.Boolean JavaDoc)child).booleanValue() == _Vetoable) {
1204                if (returnConstName) {
1205                    return VETOABLE;
1206                } else if (returnSchemaName) {
1207                    return "vetoable";
1208                } else if (returnXPathName) {
1209                    return "vetoable";
1210                } else {
1211                    return "Vetoable";
1212                }
1213            }
1214            if (((java.lang.Boolean JavaDoc)child).booleanValue() == _SkipGeneration) {
1215                if (returnConstName) {
1216                    return SKIP_GENERATION;
1217                } else if (returnSchemaName) {
1218                    return "skip-generation";
1219                } else if (returnXPathName) {
1220                    return "skip-generation";
1221                } else {
1222                    return "SkipGeneration";
1223                }
1224            }
1225            if (((java.lang.Boolean JavaDoc)child).booleanValue() == _CanBeEmpty) {
1226                if (returnConstName) {
1227                    return CAN_BE_EMPTY;
1228                } else if (returnSchemaName) {
1229                    return "can-be-empty";
1230                } else if (returnXPathName) {
1231                    return "can-be-empty";
1232                } else {
1233                    return "CanBeEmpty";
1234                }
1235            }
1236        }
1237        return null;
1238    }
1239
1240    /**
1241     * Return an array of all of the properties that are beans and are set.
1242     */

1243    public org.netbeans.modules.schema2beansdev.metadd.CommonBean[] childBeans(boolean recursive) {
1244        java.util.List JavaDoc children = new java.util.LinkedList JavaDoc();
1245        childBeans(recursive, children);
1246        org.netbeans.modules.schema2beansdev.metadd.CommonBean[] result = new org.netbeans.modules.schema2beansdev.metadd.CommonBean[children.size()];
1247        return (org.netbeans.modules.schema2beansdev.metadd.CommonBean[]) children.toArray(result);
1248    }
1249
1250    /**
1251     * Put all child beans into the beans list.
1252     */

1253    public void childBeans(boolean recursive, java.util.List JavaDoc beans) {
1254        for (java.util.Iterator JavaDoc it = _MetaProperty.iterator();
1255            it.hasNext(); ) {
1256            org.netbeans.modules.schema2beansdev.metadd.MetaProperty element = (org.netbeans.modules.schema2beansdev.metadd.MetaProperty)it.next();
1257            if (element != null) {
1258                if (recursive) {
1259                    element.childBeans(true, beans);
1260                }
1261                beans.add(element);
1262            }
1263        }
1264    }
1265
1266    public boolean equals(Object JavaDoc o) {
1267        return o instanceof org.netbeans.modules.schema2beansdev.metadd.MetaElement && equals((org.netbeans.modules.schema2beansdev.metadd.MetaElement) o);
1268    }
1269
1270    public boolean equals(org.netbeans.modules.schema2beansdev.metadd.MetaElement inst) {
1271        if (inst == this) {
1272            return true;
1273        }
1274        if (inst == null) {
1275            return false;
1276        }
1277        if (!(_DtdName == null ? inst._DtdName == null : _DtdName.equals(inst._DtdName))) {
1278            return false;
1279        }
1280        if (!(_Namespace == null ? inst._Namespace == null : _Namespace.equals(inst._Namespace))) {
1281            return false;
1282        }
1283        if (!(_BeanName == null ? inst._BeanName == null : _BeanName.equals(inst._BeanName))) {
1284            return false;
1285        }
1286        if (!(_BeanClass == null ? inst._BeanClass == null : _BeanClass.equals(inst._BeanClass))) {
1287            return false;
1288        }
1289        if (!(_WrapperClass == null ? inst._WrapperClass == null : _WrapperClass.equals(inst._WrapperClass))) {
1290            return false;
1291        }
1292        if (sizeDefaultValue() != inst.sizeDefaultValue())
1293            return false;
1294        // Compare every element.
1295
for (java.util.Iterator JavaDoc it = _DefaultValue.iterator(), it2 = inst._DefaultValue.iterator();
1296            it.hasNext() && it2.hasNext(); ) {
1297            String JavaDoc element = (String JavaDoc)it.next();
1298            String JavaDoc element2 = (String JavaDoc)it2.next();
1299            if (!(element == null ? element2 == null : element.equals(element2))) {
1300                return false;
1301            }
1302        }
1303        if (sizeKnownValue() != inst.sizeKnownValue())
1304            return false;
1305        // Compare every element.
1306
for (java.util.Iterator JavaDoc it = _KnownValue.iterator(), it2 = inst._KnownValue.iterator();
1307            it.hasNext() && it2.hasNext(); ) {
1308            String JavaDoc element = (String JavaDoc)it.next();
1309            String JavaDoc element2 = (String JavaDoc)it2.next();
1310            if (!(element == null ? element2 == null : element.equals(element2))) {
1311                return false;
1312            }
1313        }
1314        if (sizeMetaProperty() != inst.sizeMetaProperty())
1315            return false;
1316        // Compare every element.
1317
for (java.util.Iterator JavaDoc it = _MetaProperty.iterator(), it2 = inst._MetaProperty.iterator();
1318            it.hasNext() && it2.hasNext(); ) {
1319            org.netbeans.modules.schema2beansdev.metadd.MetaProperty element = (org.netbeans.modules.schema2beansdev.metadd.MetaProperty)it.next();
1320            org.netbeans.modules.schema2beansdev.metadd.MetaProperty element2 = (org.netbeans.modules.schema2beansdev.metadd.MetaProperty)it2.next();
1321            if (!(element == null ? element2 == null : element.equals(element2))) {
1322                return false;
1323            }
1324        }
1325        if (sizeComparatorClass() != inst.sizeComparatorClass())
1326            return false;
1327        // Compare every element.
1328
for (java.util.Iterator JavaDoc it = _ComparatorClass.iterator(), it2 = inst._ComparatorClass.iterator();
1329            it.hasNext() && it2.hasNext(); ) {
1330            String JavaDoc element = (String JavaDoc)it.next();
1331            String JavaDoc element2 = (String JavaDoc)it2.next();
1332            if (!(element == null ? element2 == null : element.equals(element2))) {
1333                return false;
1334            }
1335        }
1336        if (!(_Implements == null ? inst._Implements == null : _Implements.equals(inst._Implements))) {
1337            return false;
1338        }
1339        if (!(_Extends == null ? inst._Extends == null : _Extends.equals(inst._Extends))) {
1340            return false;
1341        }
1342        if (sizeImport() != inst.sizeImport())
1343            return false;
1344        // Compare every element.
1345
for (java.util.Iterator JavaDoc it = _Import.iterator(), it2 = inst._Import.iterator();
1346            it.hasNext() && it2.hasNext(); ) {
1347            String JavaDoc element = (String JavaDoc)it.next();
1348            String JavaDoc element2 = (String JavaDoc)it2.next();
1349            if (!(element == null ? element2 == null : element.equals(element2))) {
1350                return false;
1351            }
1352        }
1353        if (!(_UserCode == null ? inst._UserCode == null : _UserCode.equals(inst._UserCode))) {
1354            return false;
1355        }
1356        if (_isSet_Vetoable != inst._isSet_Vetoable) {
1357            return false;
1358        }
1359        if (_isSet_Vetoable) {
1360            if (!(_Vetoable == inst._Vetoable)) {
1361                return false;
1362            }
1363        }
1364        if (_isSet_SkipGeneration != inst._isSet_SkipGeneration) {
1365            return false;
1366        }
1367        if (_isSet_SkipGeneration) {
1368            if (!(_SkipGeneration == inst._SkipGeneration)) {
1369                return false;
1370            }
1371        }
1372        if (!(_DelegatorName == null ? inst._DelegatorName == null : _DelegatorName.equals(inst._DelegatorName))) {
1373            return false;
1374        }
1375        if (!(_DelegatorExtends == null ? inst._DelegatorExtends == null : _DelegatorExtends.equals(inst._DelegatorExtends))) {
1376            return false;
1377        }
1378        if (!(_BeanInterfaceExtends == null ? inst._BeanInterfaceExtends == null : _BeanInterfaceExtends.equals(inst._BeanInterfaceExtends))) {
1379            return false;
1380        }
1381        if (_isSet_CanBeEmpty != inst._isSet_CanBeEmpty) {
1382            return false;
1383        }
1384        if (_isSet_CanBeEmpty) {
1385            if (!(_CanBeEmpty == inst._CanBeEmpty)) {
1386                return false;
1387            }
1388        }
1389        return true;
1390    }
1391
1392    public int hashCode() {
1393        int result = 17;
1394        result = 37*result + (_DtdName == null ? 0 : _DtdName.hashCode());
1395        result = 37*result + (_Namespace == null ? 0 : _Namespace.hashCode());
1396        result = 37*result + (_BeanName == null ? 0 : _BeanName.hashCode());
1397        result = 37*result + (_BeanClass == null ? 0 : _BeanClass.hashCode());
1398        result = 37*result + (_WrapperClass == null ? 0 : _WrapperClass.hashCode());
1399        result = 37*result + (_DefaultValue == null ? 0 : _DefaultValue.hashCode());
1400        result = 37*result + (_KnownValue == null ? 0 : _KnownValue.hashCode());
1401        result = 37*result + (_MetaProperty == null ? 0 : _MetaProperty.hashCode());
1402        result = 37*result + (_ComparatorClass == null ? 0 : _ComparatorClass.hashCode());
1403        result = 37*result + (_Implements == null ? 0 : _Implements.hashCode());
1404        result = 37*result + (_Extends == null ? 0 : _Extends.hashCode());
1405        result = 37*result + (_Import == null ? 0 : _Import.hashCode());
1406        result = 37*result + (_UserCode == null ? 0 : _UserCode.hashCode());
1407        result = 37*result + (_isSet_Vetoable ? 0 : (_Vetoable ? 0 : 1));
1408        result = 37*result + (_isSet_SkipGeneration ? 0 : (_SkipGeneration ? 0 : 1));
1409        result = 37*result + (_DelegatorName == null ? 0 : _DelegatorName.hashCode());
1410        result = 37*result + (_DelegatorExtends == null ? 0 : _DelegatorExtends.hashCode());
1411        result = 37*result + (_BeanInterfaceExtends == null ? 0 : _BeanInterfaceExtends.hashCode());
1412        result = 37*result + (_isSet_CanBeEmpty ? 0 : (_CanBeEmpty ? 0 : 1));
1413        return result;
1414    }
1415
1416    public String JavaDoc toString() {
1417        java.io.StringWriter JavaDoc sw = new java.io.StringWriter JavaDoc();
1418        try {
1419            writeNode(sw);
1420        } catch (java.io.IOException JavaDoc e) {
1421            // How can we actually get an IOException on a StringWriter?
1422
throw new RuntimeException JavaDoc(e);
1423        }
1424        return sw.toString();
1425    }
1426
1427}
1428
1429
1430/*
1431        The following schema file has been used for generation:
1432
1433<!-- This holds data about the schema that is not part of DTDs and/or XML Schemas.
1434-->
1435
1436<!--
1437-->
1438<!ELEMENT metaDD (meta-element*, implements?, extends?, import*, vetoable?, throw-exceptions?, schemaLocation?, finder*)>
1439
1440<!--
1441-->
1442<!ELEMENT meta-element (dtd-name, namespace?, bean-name?, bean-class?, wrapper-class?, default-value*, known-value*, meta-property*, comparator-class*, implements?, extends?, import*, user-code?, vetoable?, skip-generation?, delegator-name?, delegator-extends?, bean-interface-extends?, can-be-empty?>
1443
1444<!--
1445-->
1446<!ELEMENT meta-property (bean-name, default-value*, known-value*, key?, vetoable?)>
1447
1448<!ELEMENT delegator-name (#PCDATA)>
1449
1450<!--
1451-->
1452<!ELEMENT implements (#PCDATA)>
1453
1454<!--
1455-->
1456<!ELEMENT extends (#PCDATA)>
1457
1458<!--
1459-->
1460<!ELEMENT import (#PCDATA)>
1461
1462<!--
1463-->
1464<!ELEMENT dtd-name (#PCDATA)>
1465
1466<!ELEMENT namespace (#PCDATA)>
1467
1468<!--
1469-->
1470<!ELEMENT default-value (#PCDATA)>
1471
1472<!--
1473-->
1474<!ELEMENT skip-generation EMPTY>
1475
1476<!--
1477-->
1478<!ELEMENT key EMPTY>
1479
1480<!--
1481-->
1482<!ELEMENT vetoable EMPTY>
1483
1484<!--
1485-->
1486<!ELEMENT known-value (#PCDATA)>
1487
1488<!--
1489-->
1490<!ELEMENT bean-name (#PCDATA)>
1491
1492<!--
1493-->
1494<!ELEMENT bean-class (#PCDATA)>
1495
1496<!--
1497-->
1498<!ELEMENT wrapper-class (#PCDATA)>
1499
1500<!--
1501-->
1502<!ELEMENT comparator-class (#PCDATA)>
1503
1504<!--
1505-->
1506<!ELEMENT user-code (#PCDATA)>
1507
1508<!ELEMENT throw-exceptions EMPTY>
1509
1510<!-- Automatically set the schemaLocation -->
1511<!ELEMENT schemaLocation (#PCDATA)>
1512
1513<!ELEMENT finder (#PCDATA)>
1514
1515<!ELEMENT bean-interface-extends (#PCDATA)>
1516
1517<!ELEMENT can-be-empty EMPTY>
1518
1519*/

1520
Popular Tags