KickJava   Java API By Example, From Geeks To Geeks.

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


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 LocaleCharsetMap matches the schema element locale-charset-map
26  *
27  * Generated on Tue Sep 02 18:08:42 PDT 2003
28  */

29
30 package com.sun.enterprise.tools.common.dd.webapp;
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 LocaleCharsetMap extends com.sun.enterprise.tools.common.dd.SunBaseBean
40 {
41
42     static Vector comparators = new Vector();
43
44     static public final String JavaDoc LOCALE = "Locale"; // NOI18N
45
static public final String JavaDoc AGENT = "Agent"; // NOI18N
46
static public final String JavaDoc CHARSET = "Charset"; // NOI18N
47
static public final String JavaDoc DESCRIPTION = "Description"; // NOI18N
48

49     public LocaleCharsetMap() {
50         this(Common.USE_DEFAULT_VALUES);
51     }
52
53     public LocaleCharsetMap(int options)
54     {
55         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
56         // Properties (see root bean comments for the bean graph)
57
this.createProperty("description", // NOI18N
58
DESCRIPTION,
59             Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY,
60             String JavaDoc.class);
61         this.initialize(options);
62     }
63
64     // Setting the default values of the properties
65
void initialize(int options)
66     {
67     
68     }
69
70     // This attribute is mandatory
71
public void setLocale(java.lang.String JavaDoc value) {
72         setAttributeValue(LOCALE, value);
73     }
74
75     //
76
public java.lang.String JavaDoc getLocale() {
77         return getAttributeValue(LOCALE);
78     }
79
80     // This attribute is optional
81
public void setAgent(java.lang.String JavaDoc value) {
82         setAttributeValue(AGENT, value);
83     }
84
85     //
86
public java.lang.String JavaDoc getAgent() {
87         return getAttributeValue(AGENT);
88     }
89
90     // This attribute is mandatory
91
public void setCharset(java.lang.String JavaDoc value) {
92         setAttributeValue(CHARSET, value);
93     }
94
95     //
96
public java.lang.String JavaDoc getCharset() {
97         return getAttributeValue(CHARSET);
98     }
99
100     // This attribute is optional
101
public void setDescription(String JavaDoc value) {
102         this.setValue(DESCRIPTION, value);
103     }
104
105     //
106
public String JavaDoc getDescription() {
107         return (String JavaDoc)this.getValue(DESCRIPTION);
108     }
109
110     //
111
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
112         comparators.add(c);
113     }
114
115     //
116
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
117         comparators.remove(c);
118     }
119     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
120         boolean restrictionFailure = false;
121         // Validating property locale
122
if (getLocale() == null) {
123             throw new org.netbeans.modules.schema2beans.ValidateException("getLocale() == null", "locale", this); // NOI18N
124
}
125         // Validating property agent
126
if (getAgent() != null) {
127         }
128         // Validating property charset
129
if (getCharset() == null) {
130             throw new org.netbeans.modules.schema2beans.ValidateException("getCharset() == null", "charset", this); // NOI18N
131
}
132         // Validating property description
133
if (getDescription() != null) {
134         }
135     }
136
137     // Dump the content of this bean returning it as a String
138
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
139         String JavaDoc s;
140         Object JavaDoc o;
141         org.netbeans.modules.schema2beans.BaseBean n;
142         str.append(indent);
143         str.append("Description"); // NOI18N
144
str.append(indent+"\t"); // NOI18N
145
str.append("<"); // NOI18N
146
s = this.getDescription();
147         str.append((s==null?"null":s.trim())); // NOI18N
148
str.append(">\n"); // NOI18N
149
this.dumpAttributes(DESCRIPTION, 0, str, indent);
150
151     }
152     public String JavaDoc dumpBeanNode(){
153         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
154         str.append("LocaleCharsetMap\n"); // NOI18N
155
this.dump(str, "\n "); // NOI18N
156
return str.toString();
157     }}
158
159 // END_NOI18N
160

161
162 /*
163         The following schema file has been used for generation:
164
165 <!--
166   XML DTD for Sun ONE Application Server specific Web Application
167   deployment descriptor. This is a companion DTD for web-app_2_4.xsd
168
169   $Revision: 1.3 $
170 -->
171
172 <!-- root element for vendor specific web application (module) configuration -->
173 <!ELEMENT sun-web-app (context-root?, security-role-mapping*, servlet*, session-config?,
174                        ejb-ref*, resource-ref*, resource-env-ref*, service-ref*,
175                        cache?, class-loader?,
176                        jsp-config?, locale-charset-info?, property*,
177                    message-destination*, webservice-description*)>
178
179 <!--
180  Context Root for the web application when the war file is a standalone module.
181  When the war module is part of the J2EE Application, use the application.xml
182 -->
183 <!ELEMENT context-root (#PCDATA)>
184
185 <!ELEMENT security-role-mapping (role-name, (principal-name | group-name)+)>
186 <!ELEMENT role-name (#PCDATA)>
187
188 <!ELEMENT principal-name (#PCDATA)>
189 <!ELEMENT group-name (#PCDATA)>
190
191 <!ELEMENT servlet (servlet-name, principal-name?, webservice-endpoint*)>
192
193 <!ELEMENT session-config (session-manager?, session-properties?, cookie-properties?)>
194
195 <!ELEMENT session-manager (manager-properties?, store-properties?)>
196 <!ATTLIST session-manager persistence-type CDATA "memory">
197
198 <!ELEMENT manager-properties (property*)>
199 <!ELEMENT store-properties (property*)>
200 <!ELEMENT session-properties (property*)>
201 <!ELEMENT cookie-properties (property*)>
202
203 <!ELEMENT jndi-name (#PCDATA)>
204
205 <!ELEMENT resource-env-ref (resource-env-ref-name, jndi-name)>
206 <!ELEMENT resource-env-ref-name (#PCDATA)>
207            
208 <!ELEMENT resource-ref (res-ref-name, jndi-name, default-resource-principal?)>
209 <!ELEMENT res-ref-name (#PCDATA)>
210
211 <!ELEMENT default-resource-principal ( name, password)>
212
213 <!--
214 This node holds information about a logical message destination
215 -->
216 <!ELEMENT message-destination (message-destination-name, jndi-name)>
217
218 <!--
219 This node holds the name of a logical message destination
220 -->
221 <!ELEMENT message-destination-name (#PCDATA)>
222
223 <!--
224 This text nodes holds a name string.
225 -->
226 <!ELEMENT name (#PCDATA)>
227
228 <!--
229 This element holds password text.
230 -->
231 <!ELEMENT password (#PCDATA)>
232
233
234 <!ELEMENT ejb-ref (ejb-ref-name, jndi-name)>
235 <!ELEMENT ejb-ref-name (#PCDATA)>
236
237 <!-- cache element configures the cache for web application. iAS 7.0 web container
238      supports one such cache object per application: i.e. <cache> is a sub element
239      of <ias-web-app>. A cache can have zero or more cache-mapping elements and
240      zero or more customizable cache-helper classes.
241                                                                                    
242         max-entries Maximum number of entries this cache may hold. [4096]
243         timeout-in-seconds Default timeout for the cache entries in seconds. [30]
244         enabled Is this cache enabled? [false]
245 -->
246 <!ELEMENT cache (cache-helper*, default-helper?, property*, cache-mapping*)>
247 <!ATTLIST cache max-entries CDATA "4096"
248                  timeout-in-seconds CDATA "30"
249                  enabled CDATA "false">
250
251 <!-- cache-helper specifies customizable class which implements CacheHelper interface.
252
253      name Unique name for the helper class; this is referenced in
254                               the cache-mapping elements (see below).
255                               "default" is reserved for the built-in default helper.
256      class-name Fully qualified class name of the cache-helper; this class
257                               must extend the com.sun.appserv.web.CacheHelper class.
258 -->
259 <!ELEMENT cache-helper (property*)>
260 <!ATTLIST cache-helper name CDATA #REQUIRED
261                        class-name CDATA #REQUIRED>
262
263 <!--
264 Default, built-in cache-helper properties
265 -->
266 <!ELEMENT default-helper (property*)>
267
268 <!--
269 cache-mapping element defines what to be cached, the key to be used, any other
270 constraints to be applied and a customizable cache-helper to programmatically
271 hook this information.
272 -->
273 <!ELEMENT cache-mapping ((servlet-name | url-pattern),
274                         (cache-helper-ref |
275                         (timeout?, refresh-field?, http-method*, key-field*, constraint-field*)))>
276
277 <!--
278 servlet-name element defines a named servlet to which this caching is enabled.
279 the specified name must be present in the web application deployment descriptor
280 (web.xml)
281 -->
282 <!ELEMENT servlet-name (#PCDATA)>
283
284 <!--
285 url-pattern element specifies the url pattern to which caching is to be enabled.
286 See Servlet 2.3 specification section SRV. 11.2 for the applicable patterns.
287 -->
288 <!ELEMENT url-pattern (#PCDATA)>
289
290 <!--
291 cache-helper-ref s a reference to the cache-helper used by this cache-mapping
292 -->
293 <!ELEMENT cache-helper-ref (#PCDATA)>
294
295 <!--
296 timeout element defines the cache timeout in seconds applicable for this mapping.
297 default is to use cache object's timeout. The timeout value is specified statically
298 ere (e.g. <timeout> 60 </timeout> or dynamically via fields in the relevant scope.
299
300    name Name of the field where this timeout could be found
301    scope Scope of the field. default scope is request attribute.
302 -->
303 <!ELEMENT timeout (#PCDATA)>
304 <!ATTLIST timeout name CDATA #REQUIRED
305                    scope CDATA 'request.attribute'>
306
307 <!--
308 http-method specifies HTTP method eligible for caching default is GET.
309 -->
310 <!ELEMENT http-method (#PCDATA)>
311
312 <!--
313 specifies the request parameter name that triggers refresh. the cached entry
314 is refreshed when there such a request parameter is set to "true"
315 example:
316 <cache-mapping>
317     <url-pattern> /quote </url-pattern>
318     <refresh-field name="refresh" scope="request.parameter"/>
319 </cache-mapping>
320 -->
321 <!ELEMENT refresh-field EMPTY>
322 <!ATTLIST refresh-field name CDATA #REQUIRED
323                         scope CDATA 'request.parameter'>
324 <!--
325 key-field specifies a component of the key; container looks for the named
326 field in the given scope to access the cached entry. Default is to use
327 the Servlet Path (the path section that corresponds to the servlet mapping
328 which activated this request). See Servlet 2.3 specification section SRV 4.4
329 on Servlet Path.
330
331   name Name of the field to look for in the given scope
332   scope Scope of the field. default scope is request parameter.
333 -->
334 <!ELEMENT key-field EMPTY>
335 <!ATTLIST key-field name CDATA #REQUIRED
336                     scope CDATA 'request.parameter'>
337
338 <!--
339 constraint-field specifies a field whose value is used as a cacheability constraint.
340   
341   name Name of the field to look for in the given scope
342   scope Scope of the field. Default scope is request parameter.
343   cache-on-match Should this constraint check pass, is the response cacheable?
344                            Default is true (i.e. cache the response on success match).
345                            Useful to turn off caching when there is an attribute in the
346                            scope (e.g. don't cache when there is an attribute called UID
347                            in the session.attribute scope).
348   cache-on-match-failure Should the constraint check fail, is response not cacheable?
349                            Default is false (i.e. a failure in enforcing the constraint
350                            would negate caching). Useful to turn on caching when the
351                            an an attribute is not present (e.g. turn on caching
352                            when there is no session or session attribute called UID).
353
354   Example 1: don't cache when there is a session attribute
355   <constraint-field name="UID" scope="session.attribute" cache-on-match="false">
356
357   Example 2: do cache only when there is no session attribute
358   <constraint-field name="UID" scope="session.attribute"
359                     cache-on-match-failure="false">
360 -->
361 <!ELEMENT constraint-field (constraint-field-value*)>
362 <!ATTLIST constraint-field name CDATA #REQUIRED
363                             scope CDATA 'request.parameter'
364                             cache-on-match CDATA 'true'
365                             cache-on-match-failure CDATA 'false'>
366
367 <!--
368 value element specifies the applicable value and a matching expression for a constraint-field
369   match-expr Expression used to match the value. Default is 'equals'.
370
371   Example 1: cache when the category matches with any value other than a specific value
372   <constraint-field name="category" scope="request.parameter>
373     <value match-expr="equals" cache-on-match-failure="true">
374          bogus
375     </value>
376   </constraint-field>
377 -->
378 <!ELEMENT constraint-field-value (#PCDATA)>
379 <!ATTLIST constraint-field-value match-expr CDATA 'equals'
380                             cache-on-match CDATA 'true'
381                             cache-on-match-failure CDATA 'false'>
382
383 <!ELEMENT class-loader EMPTY>
384 <!ATTLIST class-loader extra-class-path CDATA #IMPLIED
385                        delegate CDATA 'true'>
386
387 <!ELEMENT jsp-config (property*)>
388
389 <!ELEMENT locale-charset-info (locale-charset-map+, parameter-encoding?)>
390 <!ATTLIST locale-charset-info default-locale CDATA #REQUIRED>
391
392 <!ELEMENT locale-charset-map (description?)>
393 <!ATTLIST locale-charset-map locale CDATA #REQUIRED
394                              agent CDATA #IMPLIED
395                              charset CDATA #REQUIRED>
396
397 <!ELEMENT parameter-encoding EMPTY>
398 <!ATTLIST parameter-encoding form-hint-field CDATA #IMPLIED
399                  default-charset CDATA #IMPLIED>
400
401 <!--
402 Syntax for supplying properties as name value pairs
403 -->
404 <!ELEMENT property (description?)>
405 <!ATTLIST property name CDATA #REQUIRED
406                    value CDATA #REQUIRED>
407
408 <!ELEMENT description (#PCDATA)>
409
410 <!--
411 This text nodes holds a value string.
412 -->
413 <!ELEMENT value (#PCDATA)>
414
415
416 <!--
417                     W E B S E R V I C E S
418 -->
419 <!--
420 Runtime settings for a web service reference. In the simplest case,
421 there is no runtime information required for a service ref. Runtime info
422 is only needed in the following cases :
423  * to define the port that should be used to resolve a container-managed port
424  * to define default Stub/Call property settings for Stub objects
425  * to define the URL of a final WSDL document to be used instead of
426 the one packaged with a service-ref
427 -->
428 <!ELEMENT service-ref ( service-ref-name, port-info*, call-property*, wsdl-override?, service-impl-class?, service-qname? )>
429
430 <!--
431 Coded name (relative to java:comp/env) for a service-reference
432 -->
433 <!ELEMENT service-ref-name ( #PCDATA )>
434
435 <!--
436 Information for a port within a service-reference.
437
438 Either service-endpoint-interface or wsdl-port or both
439 (service-endpoint-interface and wsdl-port) should be specified.
440
441 If both are specified, wsdl-port represents the
442 port the container should choose for container-managed port selection.
443
444 The same wsdl-port value must not appear in
445 more than one port-info entry within the same service-ref.
446
447 If a particular service-endpoint-interface is using container-managed port
448 selection, it must not appear in more than one port-info entry
449 within the same service-ref.
450
451 -->
452 <!ELEMENT port-info ( service-endpoint-interface?, wsdl-port?, stub-property*, call-property* )>
453
454 <!--
455 Fully qualified name of service endpoint interface
456 -->
457 <!ELEMENT service-endpoint-interface ( #PCDATA )>
458 <!--
459 Port used in port-info.
460 -->
461 <!ELEMENT wsdl-port ( namespaceURI, localpart )>
462
463 <!--
464 JAXRPC property values that should be set on a stub before it's returned to
465 to the web service client. The property names can be any properties supported
466 by the JAXRPC Stub implementation. See javadoc for javax.xml.rpc.Stub
467 -->
468 <!ELEMENT stub-property ( name, value )>
469
470 <!--
471 JAXRPC property values that should be set on a Call object before it's
472 returned to the web service client. The property names can be any
473 properties supported by the JAXRPC Call implementation. See javadoc
474 for javax.xml.rpc.Call
475 -->
476 <!ELEMENT call-property ( name, value )>
477
478 <!--
479 This is a valid URL pointing to a final WSDL document. It is optional.
480 If specified, the WSDL document at this URL will be used during
481 deployment instead of the WSDL document associated with the
482 service-ref in the standard deployment descriptor.
483
484 Examples :
485
486   // available via HTTP
487   <wsdl-override>http://localhost:8000/myservice/myport?WSDL</wsdl-override>
488
489   // in a file
490   <wsdl-override>file:/home/user1/myfinalwsdl.wsdl</wsdl-override>
491
492 -->
493 <!ELEMENT wsdl-override ( #PCDATA )>
494
495 <!--
496 Name of generated service implementation class. This is not set by the
497 deployer. It is derived during deployment.
498 -->
499 <!ELEMENT service-impl-class ( #PCDATA )>
500
501 <!--
502 The service-qname element declares the specific WSDL service
503 element that is being refered to. It is not set by the deployer.
504 It is derived during deployment.
505 -->
506 <!ELEMENT service-qname (namespaceURI, localpart)>
507
508 <!--
509 Runtime information about a web service.
510
511 wsdl-publish-location is optionally used to specify
512 where the final wsdl and any dependent files should be stored. This location
513 resides on the file system from which deployment is initiated.
514
515 -->
516 <!ELEMENT webservice-description ( webservice-description-name, wsdl-publish-location? )>
517
518 <!--
519 Unique name of a webservice within a module
520 -->
521 <!ELEMENT webservice-description-name ( #PCDATA )>
522
523 <!--
524 file: URL of a directory to which a web-service-description's wsdl should be
525 published during deployment. Any required files will be published to this
526 directory, preserving their location relative to the module-specific
527 wsdl directory(META-INF/wsdl or WEB-INF/wsdl).
528
529 Example :
530
531   For an ejb.jar whose webservices.xml wsdl-file element contains
532     META-INF/wsdl/a/Foo.wsdl
533
534   <wsdl-publish-location>file:/home/user1/publish
535   </wsdl-publish-location>
536
537   The final wsdl will be stored in /home/user1/publish/a/Foo.wsdl
538
539 -->
540 <!ELEMENT wsdl-publish-location ( #PCDATA )>
541
542 <!--
543 Information about a web service endpoint.
544 -->
545 <!ELEMENT webservice-endpoint ( port-component-name, endpoint-address-uri?, login-config?, transport-guarantee?, service-qname?, tie-class?, servlet-impl-class? )>
546
547 <!--
548 Unique name of a port component within a module
549 -->
550 <!ELEMENT port-component-name ( #PCDATA )>
551
552 <!--
553 Relative path combined with web server root to form fully qualified
554 endpoint address for a web service endpoint. For servlet endpoints, this
555 value is relative to the servlet's web application context root. In
556 all cases, this value must be a fixed pattern(i.e. no "*" allowed).
557 If the web service endpoint is a servlet that only implements a single
558 endpoint has only one url-pattern, it is not necessary to set
559 this value since the container can derive it from web.xml.
560 -->
561 <!ELEMENT endpoint-address-uri ( #PCDATA )>
562
563 <!--
564 The name of tie implementation class for a port-component. This is
565 not specified by the deployer. It is derived during deployment.
566 -->
567 <!ELEMENT tie-class (#PCDATA)>
568
569 <!--
570 Optional authentication configuration for an EJB web service endpoint.
571 Not needed for servet web service endpoints. Their security configuration
572 is contained in the standard web application descriptor.
573 -->
574 <!ELEMENT login-config ( auth-method )>
575
576 <!--
577 The auth-method element is used to configure the authentication
578 mechanism for the web application. As a prerequisite to gaining access
579 to any web resources which are protected by an authorization
580 constraint, a user must have authenticated using the configured
581 mechanism.
582 -->
583
584 <!ELEMENT auth-method (#PCDATA)>
585
586 <!--
587 Name of application-written servlet impl class contained in deployed war.
588 This is not set by the deployer. It is derived by the container
589 during deployment.
590 -->
591 <!ELEMENT servlet-impl-class (#PCDATA)>
592
593 <!--
594 The transport-guarantee element specifies that the communication
595 between client and server should be NONE, INTEGRAL, or
596 CONFIDENTIAL. NONE means that the application does not require any
597 transport guarantees. A value of INTEGRAL means that the application
598 requires that the data sent between the client and server be sent in
599 such a way that it can't be changed in transit. CONFIDENTIAL means
600 that the application requires that the data be transmitted in a
601 fashion that prevents other entities from observing the contents of
602 the transmission. In most cases, the presence of the INTEGRAL or
603 CONFIDENTIAL flag will indicate that the use of SSL is required.
604 -->
605
606 <!ELEMENT transport-guarantee (#PCDATA)>
607
608 <!--
609 Runtime settings for a web service reference. In the simplest case,
610 there is no runtime information required for a service ref. Runtime info
611 is only needed in the following cases :
612  * to define the port that should be used to resolve a container-managed port
613  * to define default Stub/Call property settings for Stub objects
614  * to define the URL of a final WSDL document to be used instead of
615 the one packaged with a service-ref
616 -->
617
618 <!--
619 The localpart element indicates the local part of a QNAME.
620 -->
621 <!ELEMENT localpart (#PCDATA)>
622
623 <!--
624 The namespaceURI element indicates a URI.
625 -->
626 <!ELEMENT namespaceURI (#PCDATA)>
627
628 */

629
Popular Tags