KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > tools > common > dd > application > Web


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 Web matches the schema element web
26  *
27  * Generated on Thu Jul 31 15:31:46 PDT 2003
28  */

29
30 package com.sun.enterprise.tools.common.dd.application;
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 Web extends com.sun.enterprise.tools.common.dd.SunBaseBean
40 {
41
42     static Vector comparators = new Vector();
43
44     static public final String JavaDoc WEB_URI = "WebUri"; // NOI18N
45
static public final String JavaDoc CONTEXT_ROOT = "ContextRoot"; // NOI18N
46

47     public Web() {
48         this(Common.USE_DEFAULT_VALUES);
49     }
50
51     public Web(int options)
52     {
53         super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0));
54         // Properties (see root bean comments for the bean graph)
55
this.createProperty("web-uri", // NOI18N
56
WEB_URI,
57             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
58             String JavaDoc.class);
59         this.createProperty("context-root", // NOI18N
60
CONTEXT_ROOT,
61             Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY,
62             String JavaDoc.class);
63         this.initialize(options);
64     }
65
66     // Setting the default values of the properties
67
void initialize(int options)
68     {
69         
70     }
71
72     // This attribute is mandatory
73
public void setWebUri(String JavaDoc value) {
74         this.setValue(WEB_URI, value);
75     }
76
77     //
78
public String JavaDoc getWebUri() {
79         return (String JavaDoc)this.getValue(WEB_URI);
80     }
81
82     // This attribute is mandatory
83
public void setContextRoot(String JavaDoc value) {
84         this.setValue(CONTEXT_ROOT, value);
85     }
86
87     //
88
public String JavaDoc getContextRoot() {
89         return (String JavaDoc)this.getValue(CONTEXT_ROOT);
90     }
91
92     //
93
public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
94         comparators.add(c);
95     }
96
97     //
98
public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) {
99         comparators.remove(c);
100     }
101     public void validate() throws org.netbeans.modules.schema2beans.ValidateException {
102         boolean restrictionFailure = false;
103         // Validating property webUri
104
if (getWebUri() == null) {
105             throw new org.netbeans.modules.schema2beans.ValidateException("getWebUri() == null", "webUri", this); // NOI18N
106
}
107         // Validating property contextRoot
108
if (getContextRoot() == null) {
109             throw new org.netbeans.modules.schema2beans.ValidateException("getContextRoot() == null", "contextRoot", this); // NOI18N
110
}
111     }
112
113     // Dump the content of this bean returning it as a String
114
public void dump(StringBuffer JavaDoc str, String JavaDoc indent){
115         String JavaDoc s;
116         Object JavaDoc o;
117         org.netbeans.modules.schema2beans.BaseBean n;
118         str.append(indent);
119         str.append("WebUri"); // NOI18N
120
str.append(indent+"\t"); // NOI18N
121
str.append("<"); // NOI18N
122
s = this.getWebUri();
123         str.append((s==null?"null":s.trim())); // NOI18N
124
str.append(">\n"); // NOI18N
125
this.dumpAttributes(WEB_URI, 0, str, indent);
126
127         str.append(indent);
128         str.append("ContextRoot"); // NOI18N
129
str.append(indent+"\t"); // NOI18N
130
str.append("<"); // NOI18N
131
s = this.getContextRoot();
132         str.append((s==null?"null":s.trim())); // NOI18N
133
str.append(">\n"); // NOI18N
134
this.dumpAttributes(CONTEXT_ROOT, 0, str, indent);
135
136     }
137     public String JavaDoc dumpBeanNode(){
138         StringBuffer JavaDoc str = new StringBuffer JavaDoc();
139         str.append("Web\n"); // NOI18N
140
this.dump(str, "\n "); // NOI18N
141
return str.toString();
142     }}
143
144 // END_NOI18N
145

146
147 /*
148         The following schema file has been used for generation:
149
150 <!--
151   XML DTD for Sun ONE Application Server specific J2EE Application
152   deployment descriptor. This is a companion DTD to application_1.4.xsd
153
154   $Revision: 1.3 $
155 -->
156
157 <!--
158 This is the root element of the runtime descriptor document.
159 -->
160 <!ELEMENT sun-application (web*, pass-by-reference?, unique-id?, security-role-mapping*, realm?) >
161
162 <!ELEMENT web (web-uri, context-root)>
163 <!ELEMENT web-uri (#PCDATA)>
164 <!ELEMENT context-root (#PCDATA)>
165
166 <!-- Pass by Reference semantics: EJB spec requires pass by value,
167      which will be the default mode of operation. This can be set
168      to true for non-compliant and possibly higher performance.
169      For a stand-alone, this can be set at this level. By setting
170      a similarly named element at sun-application, it can apply to
171      all the enclosed ejb modules. Allowed values are true and
172      false. Default will be false.
173  -->
174 <!ELEMENT pass-by-reference (#PCDATA)>
175
176 <!-- Automatically generated and updated at deployment/redeployment
177      Needs to be unqiue in the system.
178   -->
179 <!ELEMENT unique-id (#PCDATA)>
180
181 <!ELEMENT security-role-mapping (role-name, (principal-name | group-name)+)>
182
183 <!ELEMENT role-name (#PCDATA)>
184 <!ELEMENT principal-name (#PCDATA)>
185 <!ELEMENT group-name (#PCDATA)>
186
187 <!--
188   realm: Allows specifying an optional authentication realm name which will
189     be used to process all authentication requests associated with this
190     application. If this element is not specified (or if it is given but
191     does not match the name of a configured realm) then the default realm
192     set in the server instances security-service element will be used
193     instead.
194 -->
195 <!ELEMENT realm (#PCDATA)>
196
197 <!-- This information is used, only by Studio-plugin;it is NOT the part of the real DTD.
198 -->
199 <!ELEMENT plugin-data ( auto-generate-sql?, client-jar-path?, client-args? )>
200 <!ELEMENT auto-generate-sql (#PCDATA)>
201 <!ELEMENT client-jar-path (#PCDATA)>
202 <!ELEMENT client-args (#PCDATA)>
203
204 */

205
Popular Tags