KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > common > dd > webapp > data > HelperClassParam


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 /**
25  * This generated bean class HelperClassParam matches the schema element helper-class-param
26  *
27  * Generated on Tue Aug 12 18:27:47 PDT 2003
28  */

29
30 package com.sun.enterprise.tools.common.dd.webapp.data;
31
32 import org.w3c.dom.*;
33 import org.netbeans.modules.schema2beans.*;
34 import java.beans.*;
35 import java.util.*;
36
37 // BEGIN_NOI18N
38

39 public class HelperClassParam extends com.sun.enterprise.tools.common.dd.ParamData
40 {
41
42     static Vector comparators = new Vector();
43
44     static public final String JavaDoc PARAM_NAME = "ParamName"; // NOI18N
45
static public final String JavaDoc PARAM_TYPE = "ParamType"; // NOI18N
46
static public final String JavaDoc PARAM_VALUES = "ParamValues"; // NOI18N
47
static public final String JavaDoc DEFAULT_VALUE = "DefaultValue"; // NOI18N
48
static public final String JavaDoc HELPID = "HelpID"; // NOI18N
49

50     public HelperClassParam() {
51         this(Common.USE_DEFAULT_VALUES);
52     }
53
54     public HelperClassParam(int options)
55     {
56         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
57         // Properties (see root bean comments for the bean graph)
58
this.createProperty("param-name", // NOI18N
59
PARAM_NAME,
60             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
61             String JavaDoc.class);
62         this.createProperty("param-type", // NOI18N
63
PARAM_TYPE,
64             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
65             String JavaDoc.class);
66         this.createProperty("param-values", // NOI18N
67
PARAM_VALUES,
68             Common.TYPE_0_N | Common.TYPE_STRING | Common.TYPE_KEY,
69             String JavaDoc.class);
70         this.createProperty("default-value", // NOI18N
71
DEFAULT_VALUE,
72             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
73             String JavaDoc.class);
74         this.createProperty("helpID", // NOI18N
75
HELPID,
76             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
77             String JavaDoc.class);
78         this.initialize(options);
79     }
80
81     // Setting the default values of the properties
82
void initialize(int options)
83     {
84                     
85     }
86
87     // This attribute is mandatory
88
public void setParamName(String JavaDoc value) {
89         this.setValue(PARAM_NAME, value);
90     }
91
92     //
93
public String JavaDoc getParamName() {
94         return (String JavaDoc)this.getValue(PARAM_NAME);
95     }
96
97     // This attribute is optional
98
public void setParamType(String JavaDoc value) {
99         this.setValue(PARAM_TYPE, value);
100     }
101
102     //
103
public String JavaDoc getParamType() {
104         return (String JavaDoc)this.getValue(PARAM_TYPE);
105     }
106
107     // This attribute is an array, possibly empty
108
public void setParamValues(int index, String JavaDoc value) {
109         this.setValue(PARAM_VALUES, index, value);
110     }
111
112     //
113
public String JavaDoc getParamValues(int index) {
114         return (String JavaDoc)this.getValue(PARAM_VALUES, index);
115     }
116
117     // This attribute is an array, possibly empty
118
public void setParamValues(String JavaDoc[] value) {
119         this.setValue(PARAM_VALUES, value);
120     }
121
122     //
123
public String JavaDoc[] getParamValues() {
124         return (String JavaDoc[])this.getValues(PARAM_VALUES);
125     }
126
127     // Return the number of properties
128
public int sizeParamValues() {
129         return this.size(PARAM_VALUES);
130     }
131
132     // Add a new element returning its index in the list
133
public int addParamValues(String JavaDoc value) {
134         return this.addValue(PARAM_VALUES, value);
135     }
136
137     //
138
// Remove an element using its reference
139
// Returns the index the element had in the list
140
//
141
public int removeParamValues(String JavaDoc value) {
142         return this.removeValue(PARAM_VALUES, value);
143     }
144
145     // This attribute is optional
146
public void setDefaultValue(String JavaDoc value) {
147         this.setValue(DEFAULT_VALUE, value);
148     }
149
150     //
151
public String JavaDoc getDefaultValue() {
152         return (String JavaDoc)this.getValue(DEFAULT_VALUE);
153     }
154
155     // This attribute is optional
156
public void setHelpID(String JavaDoc value) {
157         this.setValue(HELPID, value);
158     }
159
160     //
161
public String JavaDoc getHelpID() {
162         return (String JavaDoc)this.getValue(HELPID);
163     }
164
165     //
166
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
167         comparators.add(c);
168     }
169
170     //
171
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
172         comparators.remove(c);
173     }
174     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
175         boolean restrictionFailure = false;
176         // Validating property paramName
177
if (getParamName() == null) {
178             throw new org.netbeans.modules.schema2beans.ValidateException("getParamName() == null", "paramName", this); // NOI18N
179
}
180         // Validating property paramType
181
if (getParamType() != null) {
182         }
183         // Validating property paramValues
184
for (int _index = 0; _index < sizeParamValues(); ++_index) {
185             String JavaDoc element = getParamValues(_index);
186             if (element != null) {
187             }
188         }
189         // Validating property defaultValue
190
if (getDefaultValue() != null) {
191         }
192         // Validating property helpID
193
if (getHelpID() != null) {
194         }
195     }
196
197     // Dump the content of this bean returning it as a String
198
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
199         String JavaDoc s;
200         Object JavaDoc o;
201         org.netbeans.modules.schema2beans.BaseBean n;
202         str.append(indent);
203         str.append("ParamName"); // NOI18N
204
str.append(indent+"\t"); // NOI18N
205
str.append("<"); // NOI18N
206
s = this.getParamName();
207         str.append((s==null?"null":s.trim())); // NOI18N
208
str.append(">\n"); // NOI18N
209
this.dumpAttributes(PARAM_NAME, 0, str, indent);
210
211         str.append(indent);
212         str.append("ParamType"); // NOI18N
213
str.append(indent+"\t"); // NOI18N
214
str.append("<"); // NOI18N
215
s = this.getParamType();
216         str.append((s==null?"null":s.trim())); // NOI18N
217
str.append(">\n"); // NOI18N
218
this.dumpAttributes(PARAM_TYPE, 0, str, indent);
219
220         str.append(indent);
221         str.append("ParamValues["+this.sizeParamValues()+"]"); // NOI18N
222
for(int i=0; i<this.sizeParamValues(); i++)
223         {
224             str.append(indent+"\t");
225             str.append("#"+i+":");
226             str.append(indent+"\t"); // NOI18N
227
str.append("<"); // NOI18N
228
s = this.getParamValues(i);
229             str.append((s==null?"null":s.trim())); // NOI18N
230
str.append(">\n"); // NOI18N
231
this.dumpAttributes(PARAM_VALUES, i, str, indent);
232         }
233
234         str.append(indent);
235         str.append("DefaultValue"); // NOI18N
236
str.append(indent+"\t"); // NOI18N
237
str.append("<"); // NOI18N
238
s = this.getDefaultValue();
239         str.append((s==null?"null":s.trim())); // NOI18N
240
str.append(">\n"); // NOI18N
241
this.dumpAttributes(DEFAULT_VALUE, 0, str, indent);
242
243         str.append(indent);
244         str.append("HelpID"); // NOI18N
245
str.append(indent+"\t"); // NOI18N
246
str.append("<"); // NOI18N
247
s = this.getHelpID();
248         str.append((s==null?"null":s.trim())); // NOI18N
249
str.append(">\n"); // NOI18N
250
this.dumpAttributes(HELPID, 0, str, indent);
251
252     }
253     public String JavaDoc dumpBeanNode(){
254         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
255         str.append("HelperClassParam\n"); // NOI18N
256
this.dump(str, "\n "); // NOI18N
257
return str.toString();
258     }}
259
260 // END_NOI18N
261

262
263 /*
264         The following schema file has been used for generation:
265
266 <?xml version="1.0" encoding="UTF-8"?>
267 <!-- edited with XML Spy v4.1 U (http://www.xmlspy.com) by A Gaur (Sun Microsystems) -->
268 <!ELEMENT sun-web-app-data (session-param*, cookie-param*, jsp-param*, extra-param*, manager-param*, store-param*, persistence-param*, helper-class-param*)>
269 <!ELEMENT session-param (param-name, param-type?, param-values*, default-value?, helpID?)>
270 <!ELEMENT cookie-param (param-name, param-type?, param-values*, default-value?, helpID?)>
271 <!ELEMENT jsp-param (param-name, param-type?, param-values*, default-value? helpID?)>
272 <!ELEMENT extra-param (param-name, param-type?, param-values*, default-value? helpID?)>
273 <!ELEMENT manager-param (param-name, param-type?, param-values*, default-value? helpID?)>
274 <!ELEMENT store-param (param-name, param-type?, param-values*, default-value? helpID?)>
275 <!ELEMENT persistence-param (param-name, param-type?, param-values*, default-value? helpID?)>
276 <!ELEMENT helper-class-param (param-name, param-type?, param-values*, default-value? helpID?)>
277 <!ELEMENT param-name (#PCDATA)>
278 <!ELEMENT param-type (#PCDATA)>
279 <!ELEMENT param-values (#PCDATA)>
280 <!ELEMENT default-value (#PCDATA)>
281 <!ELEMENT helpID (#PCDATA)>
282
283 */

284
Popular Tags