KickJava   Java API By Example, From Geeks To Geeks.

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


1 /**
2  * This generated bean class LocaleCharsetInfo matches the schema element locale-charset-info
3  *
4  * Generated on Sun Feb 29 21:00:47 PST 2004
5  */

6
7 package com.sun.enterprise.tools.common.dd.webapp;
8
9 import org.w3c.dom.*;
10 import org.netbeans.modules.schema2beans.*;
11 import java.beans.*;
12 import java.util.*;
13
14 // BEGIN_NOI18N
15

16 public class LocaleCharsetInfo extends com.sun.enterprise.tools.common.dd.SunBaseBean
17 {
18
19     static Vector comparators = new Vector();
20
21     static public final String JavaDoc DEFAULTLOCALE = "DefaultLocale"; // NOI18N
22
static public final String JavaDoc LOCALE_CHARSET_MAP = "LocaleCharsetMap"; // NOI18N
23
static public final String JavaDoc PARAMETER_ENCODING = "ParameterEncoding"; // NOI18N
24
static public final String JavaDoc PARAMETERENCODINGFORMHINTFIELD = "ParameterEncodingFormHintField"; // NOI18N
25
static public final String JavaDoc PARAMETERENCODINGDEFAULTCHARSET = "ParameterEncodingDefaultCharset"; // NOI18N
26

27     public LocaleCharsetInfo() {
28         this(Common.USE_DEFAULT_VALUES);
29     }
30
31     public LocaleCharsetInfo(int options)
32     {
33         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
34         // Properties (see root bean comments for the bean graph)
35
this.createProperty("locale-charset-map", // NOI18N
36
LOCALE_CHARSET_MAP,
37             Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY,
38             LocaleCharsetMap.class);
39         this.createAttribute(LOCALE_CHARSET_MAP, "locale", "Locale",
40                         AttrProp.CDATA | AttrProp.REQUIRED,
41                         null, null);
42         this.createAttribute(LOCALE_CHARSET_MAP, "agent", "Agent",
43                         AttrProp.CDATA | AttrProp.IMPLIED,
44                         null, null);
45         this.createAttribute(LOCALE_CHARSET_MAP, "charset", "Charset",
46                         AttrProp.CDATA | AttrProp.REQUIRED,
47                         null, null);
48         this.createProperty("parameter-encoding", // NOI18N
49
PARAMETER_ENCODING,
50             Common.TYPE_0_1 | Common.TYPE_BOOLEAN | Common.TYPE_KEY,
51             Boolean JavaDoc.class);
52         this.createAttribute(PARAMETER_ENCODING, "form-hint-field", "FormHintField",
53                         AttrProp.CDATA | AttrProp.IMPLIED,
54                         null, null);
55         this.createAttribute(PARAMETER_ENCODING, "default-charset", "DefaultCharset",
56                         AttrProp.CDATA | AttrProp.IMPLIED,
57                         null, null);
58         this.initialize(options);
59     }
60
61     // Setting the default values of the properties
62
void initialize(int options)
63     {
64     
65     }
66
67     // This attribute is optional
68
public void setDefaultLocale(java.lang.String JavaDoc value) {
69         setAttributeValue(DEFAULTLOCALE, value);
70     }
71
72     //
73
public java.lang.String JavaDoc getDefaultLocale() {
74         return getAttributeValue(DEFAULTLOCALE);
75     }
76
77     // This attribute is an array containing at least one element
78
public void setLocaleCharsetMap(int index, LocaleCharsetMap value) {
79         this.setValue(LOCALE_CHARSET_MAP, index, value);
80     }
81
82     //
83
public LocaleCharsetMap getLocaleCharsetMap(int index) {
84         return (LocaleCharsetMap)this.getValue(LOCALE_CHARSET_MAP, index);
85     }
86
87     // This attribute is an array containing at least one element
88
public void setLocaleCharsetMap(LocaleCharsetMap[] value) {
89         this.setValue(LOCALE_CHARSET_MAP, value);
90     }
91
92     //
93
public LocaleCharsetMap[] getLocaleCharsetMap() {
94         return (LocaleCharsetMap[])this.getValues(LOCALE_CHARSET_MAP);
95     }
96
97     // Return the number of properties
98
public int sizeLocaleCharsetMap() {
99         return this.size(LOCALE_CHARSET_MAP);
100     }
101
102     // Add a new element returning its index in the list
103
public int addLocaleCharsetMap(com.sun.enterprise.tools.common.dd.webapp.LocaleCharsetMap value) {
104         return this.addValue(LOCALE_CHARSET_MAP, value);
105     }
106
107     //
108
// Remove an element using its reference
109
// Returns the index the element had in the list
110
//
111
public int removeLocaleCharsetMap(com.sun.enterprise.tools.common.dd.webapp.LocaleCharsetMap value) {
112         return this.removeValue(LOCALE_CHARSET_MAP, value);
113     }
114
115     // This attribute is optional
116
public void setParameterEncoding(boolean value) {
117         this.setValue(PARAMETER_ENCODING, (value ? java.lang.Boolean.TRUE : java.lang.Boolean.FALSE));
118     }
119
120     //
121
public boolean isParameterEncoding() {
122         Boolean JavaDoc ret = (Boolean JavaDoc)this.getValue(PARAMETER_ENCODING);
123         if (ret == null)
124             ret = (Boolean JavaDoc)Common.defaultScalarValue(Common.TYPE_BOOLEAN);
125         return ((java.lang.Boolean JavaDoc)ret).booleanValue();
126     }
127
128     // This attribute is optional
129
public void setParameterEncodingFormHintField(java.lang.String JavaDoc value) {
130         // Make sure we've got a place to put this attribute.
131
if (size(PARAMETER_ENCODING) == 0) {
132             setValue(PARAMETER_ENCODING, "");
133         }
134         setAttributeValue(PARAMETER_ENCODING, "FormHintField", value);
135     }
136
137     //
138
public java.lang.String JavaDoc getParameterEncodingFormHintField() {
139         // If our element does not exist, then the attribute does not exist.
140
if (size(PARAMETER_ENCODING) == 0) {
141             return null;
142         } else {
143             return getAttributeValue(PARAMETER_ENCODING, "FormHintField");
144         }
145     }
146
147     // This attribute is optional
148
public void setParameterEncodingDefaultCharset(java.lang.String JavaDoc value) {
149         // Make sure we've got a place to put this attribute.
150
if (size(PARAMETER_ENCODING) == 0) {
151             setValue(PARAMETER_ENCODING, "");
152         }
153         setAttributeValue(PARAMETER_ENCODING, "DefaultCharset", value);
154     }
155
156     //
157
public java.lang.String JavaDoc getParameterEncodingDefaultCharset() {
158         // If our element does not exist, then the attribute does not exist.
159
if (size(PARAMETER_ENCODING) == 0) {
160             return null;
161         } else {
162             return getAttributeValue(PARAMETER_ENCODING, "DefaultCharset");
163         }
164     }
165
166     //
167
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
168         comparators.add(c);
169     }
170
171     //
172
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
173         comparators.remove(c);
174     }
175     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
176         boolean restrictionFailure = false;
177         // Validating property defaultLocale
178
if (getDefaultLocale() != null) {
179         }
180         // Validating property localeCharsetMap
181
if (sizeLocaleCharsetMap() == 0) {
182             throw new org.netbeans.modules.schema2beans.ValidateException("sizeLocaleCharsetMap() == 0", "localeCharsetMap", this); // NOI18N
183
}
184         for (int _index = 0; _index < sizeLocaleCharsetMap(); ++_index) {
185             com.sun.enterprise.tools.common.dd.webapp.LocaleCharsetMap element = getLocaleCharsetMap(_index);
186             if (element != null) {
187                 element.validate();
188             }
189         }
190         // Validating property parameterEncoding
191
// Validating property parameterEncodingFormHintField
192
if (getParameterEncodingFormHintField() != null) {
193         }
194         // Validating property parameterEncodingDefaultCharset
195
if (getParameterEncodingDefaultCharset() != null) {
196         }
197     }
198
199     // Dump the content of this bean returning it as a String
200
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
201         String JavaDoc s;
202         Object JavaDoc o;
203         org.netbeans.modules.schema2beans.BaseBean n;
204         str.append(indent);
205         str.append("LocaleCharsetMap["+this.sizeLocaleCharsetMap()+"]"); // NOI18N
206
for(int i=0; i<this.sizeLocaleCharsetMap(); i++)
207         {
208             str.append(indent+"\t");
209             str.append("#"+i+":");
210             n = (org.netbeans.modules.schema2beans.BaseBean) this.getLocaleCharsetMap(i);
211             if (n != null)
212                 n.dump(str, indent + "\t"); // NOI18N
213
else
214                 str.append(indent+"\tnull"); // NOI18N
215
this.dumpAttributes(LOCALE_CHARSET_MAP, i, str, indent);
216         }
217
218         str.append(indent);
219         str.append("ParameterEncoding"); // NOI18N
220
str.append(indent+"\t"); // NOI18N
221
str.append((this.isParameterEncoding()?"true":"false"));
222         this.dumpAttributes(PARAMETER_ENCODING, 0, str, indent);
223
224     }
225     public String JavaDoc dumpBeanNode(){
226         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
227         str.append("LocaleCharsetInfo\n"); // NOI18N
228
this.dump(str, "\n "); // NOI18N
229
return str.toString();
230     }}
231
232 // END_NOI18N
233

234
235 /*
236  * The contents of this file are subject to the terms
237  * of the Common Development and Distribution License
238  * (the License). You may not use this file except in
239  * compliance with the License.
240  *
241  * You can obtain a copy of the license at
242  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
243  * glassfish/bootstrap/legal/CDDLv1.0.txt.
244  * See the License for the specific language governing
245  * permissions and limitations under the License.
246  *
247  * When distributing Covered Code, include this CDDL
248  * Header Notice in each file and include the License file
249  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
250  * If applicable, add the following below the CDDL Header,
251  * with the fields enclosed by brackets [] replaced by
252  * you own identifying information:
253  * "Portions Copyrighted [year] [name of copyright owner]"
254  *
255  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
256  */

257
Popular Tags