KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > j2ee > sun > sunresources > beans > Tag


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

19 /**
20  * This generated bean class Tag matches the schema element tag
21  *
22  * Generated on Thu Sep 25 15:18:26 PDT 2003
23  */

24
25 package org.netbeans.modules.j2ee.sun.sunresources.beans;
26
27 import org.w3c.dom.*;
28 import org.netbeans.modules.schema2beans.*;
29 import java.beans.*;
30 import java.util.*;
31
32 // BEGIN_NOI18N
33

34 public class Tag extends org.netbeans.modules.schema2beans.BaseBean
35 {
36
37     static Vector comparators = new Vector();
38
39     static public final String JavaDoc TAG_ITEM = "TagItem"; // NOI18N
40

41     public Tag() {
42         this(Common.USE_DEFAULT_VALUES);
43     }
44
45     public Tag(int options)
46     {
47         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
48         // Properties (see root bean comments for the bean graph)
49
this.createProperty("tag-item", // NOI18N
50
TAG_ITEM,
51             Common.TYPE_0_N | Common.TYPE_STRING | Common.TYPE_KEY,
52             String JavaDoc.class);
53         this.initialize(options);
54     }
55
56     // Setting the default values of the properties
57
void initialize(int options)
58     {
59     
60     }
61
62     // This attribute is an array, possibly empty
63
public void setTagItem(int index, String JavaDoc value) {
64         this.setValue(TAG_ITEM, index, value);
65     }
66
67     //
68
public String JavaDoc getTagItem(int index) {
69         return (String JavaDoc)this.getValue(TAG_ITEM, index);
70     }
71
72     // This attribute is an array, possibly empty
73
public void setTagItem(String JavaDoc[] value) {
74         this.setValue(TAG_ITEM, value);
75     }
76
77     //
78
public String JavaDoc[] getTagItem() {
79         return (String JavaDoc[])this.getValues(TAG_ITEM);
80     }
81
82     // Return the number of properties
83
public int sizeTagItem() {
84         return this.size(TAG_ITEM);
85     }
86
87     // Add a new element returning its index in the list
88
public int addTagItem(String JavaDoc value) {
89         return this.addValue(TAG_ITEM, value);
90     }
91
92     //
93
// Remove an element using its reference
94
// Returns the index the element had in the list
95
//
96
public int removeTagItem(String JavaDoc value) {
97         return this.removeValue(TAG_ITEM, value);
98     }
99
100     //
101
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
102         comparators.add(c);
103     }
104
105     //
106
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
107         comparators.remove(c);
108     }
109     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
110         // Validating property tagItem
111
for (int _index = 0; _index < sizeTagItem(); ++_index) {
112             getTagItem(_index);
113
114         }
115     }
116
117     // Dump the content of this bean returning it as a String
118
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
119         String JavaDoc s;
120         str.append(indent);
121         str.append("TagItem["+this.sizeTagItem()+"]"); // NOI18N
122
for(int i=0; i<this.sizeTagItem(); i++)
123         {
124             str.append(indent+"\t");
125             str.append("#"+i+":");
126             str.append(indent+"\t"); // NOI18N
127
str.append("<"); // NOI18N
128
s = this.getTagItem(i);
129             str.append((s==null?"null":s.trim())); // NOI18N
130
str.append(">\n"); // NOI18N
131
this.dumpAttributes(TAG_ITEM, i, str, indent);
132         }
133
134     }
135     public String JavaDoc dumpBeanNode(){
136         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
137         str.append("Tag\n"); // NOI18N
138
this.dump(str, "\n "); // NOI18N
139
return str.toString();
140     }}
141
142 // END_NOI18N
143

144
145 /*
146         The following schema file has been used for generation:
147
148 <!ELEMENT wizard (name, field-group+)>
149 <!ELEMENT field-group (name, field+)>
150 <!ELEMENT field (name, field-value, tag?)>
151 <!ATTLIST field field-type CDATA "string"
152                  required CDATA "true">
153 <!ELEMENT field-value (default-field-value, option-value-pair*)>
154 <!ELEMENT option-value-pair (option-name, conditional-value)>
155 <!ELEMENT name (#PCDATA)>
156 <!ELEMENT default-field-value (#PCDATA)>
157 <!ELEMENT option-name (#PCDATA)>
158 <!ELEMENT conditional-value (#PCDATA)>
159 <!ELEMENT tag (tag-item*)>
160 <!ELEMENT tag-item (#PCDATA)>
161
162
163
164 */

165
Popular Tags