KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > JspGroupDescriptor


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 package com.sun.enterprise.deployment;
25
26 import java.util.Set JavaDoc;
27 import java.util.HashSet JavaDoc;
28 import java.util.Enumeration JavaDoc;
29 import java.util.Vector JavaDoc;
30
31 /**
32  */

33 public class JspGroupDescriptor extends Descriptor {
34     
35     private String JavaDoc elIgnored = "false";
36     private String JavaDoc scriptingInvalid = "false";
37     private String JavaDoc isXml = "false";
38     private String JavaDoc deferredSyntaxAllowedAsLiteral = "false";
39     private String JavaDoc trimDirectiveWhitespaces = "false";
40     private Set JavaDoc urlPatterns = null;
41     private Set JavaDoc includePreludes = null;
42     private Set JavaDoc includeCodas = null;
43     private String JavaDoc pageEncoding = null;
44     
45     /**
46      * Return the set of URL pattern aliases for this group.
47      */

48     public Set JavaDoc getUrlPatternsSet() {
49         if (this.urlPatterns == null) {
50             this.urlPatterns = new OrderedSet();
51         }
52         return this.urlPatterns;
53     }
54
55     /**
56      * Returns an enumeration of (String) URL pattern aliases for this
57      * group.
58      */

59     public Enumeration JavaDoc getUrlPatterns() {
60         return (new Vector JavaDoc(this.getUrlPatternsSet())).elements();
61     }
62    
63     /**
64      * Adds an alias to this jsp group.
65      */

66     public void addUrlPattern(String JavaDoc urlPattern) {
67         this.getUrlPatternsSet().add(urlPattern);
68         this.changed();
69     }
70    
71     /**
72      * Removes a URL pattern from this jsp group.
73      */

74     public void removeUrlPattern(String JavaDoc urlPattern) {
75         this.getUrlPatternsSet().remove(urlPattern);
76         this.changed();
77     }
78
79     /**
80      * Return the set of include prelude elements for this group.
81      */

82     public Set JavaDoc getIncludePreludeSet() {
83         if (this.includePreludes == null) {
84             this.includePreludes = new OrderedSet();
85         }
86         return this.includePreludes;
87     }
88
89     /**
90      * Returns an enumeration of include prelude patterns for this
91      * group.
92      */

93     public Enumeration JavaDoc getIncludePreludes() {
94         return (new Vector JavaDoc(this.getIncludePreludeSet())).elements();
95     }
96    
97     /**
98      * Adds an element
99      */

100     public void addIncludePrelude(String JavaDoc prelude) {
101         this.getIncludePreludeSet().add(prelude);
102         this.changed();
103     }
104    
105     /**
106      * Removes an element
107      */

108     public void removeIncludePrelude(String JavaDoc prelude) {
109         this.getIncludePreludeSet().remove(prelude);
110         this.changed();
111     }
112
113     /**
114      * Return the set of include coda elements for this group.
115      */

116     public Set JavaDoc getIncludeCodaSet() {
117         if (this.includeCodas == null) {
118             this.includeCodas = new OrderedSet();
119         }
120         return this.includeCodas;
121     }
122
123     /**
124      * Returns an enumeration of include coda patterns for this
125      * group.
126      */

127     public Enumeration JavaDoc getIncludeCodas() {
128         return (new Vector JavaDoc(this.getIncludeCodaSet())).elements();
129     }
130    
131     /**
132      * Adds an element
133      */

134     public void addIncludeCoda(String JavaDoc coda) {
135         this.getIncludeCodaSet().add(coda);
136         this.changed();
137     }
138    
139     /**
140      * Removes an element
141      */

142     public void removeIncludeCoda(String JavaDoc coda) {
143         this.getIncludeCodaSet().remove(coda);
144         this.changed();
145     }
146
147     /**
148      * expression evaluation
149      */

150     public void setElIngored(String JavaDoc value) {
151         elIgnored = value;
152     }
153
154     public void setElIgnored(boolean value) {
155         elIgnored = String.valueOf(value);
156     }
157
158     public String JavaDoc getElIgnored() {
159         return elIgnored;
160     }
161
162     /**
163      */

164     public boolean isElIgnored() {
165     return getBoolean(elIgnored);
166     }
167     
168     /**
169      * enable/disable scripting
170      */

171     public void setScriptingEnabled(String JavaDoc value) {
172         scriptingInvalid = value;
173     }
174
175     public void setScriptingInvalid(boolean value) {
176         scriptingInvalid = String.valueOf(value);
177     }
178
179     public String JavaDoc getScriptingInvalid() {
180     return scriptingInvalid;
181     }
182     
183     /**
184      * return if scripting is enabled.
185      */

186     public boolean isScriptingInvalid() {
187     return getBoolean(scriptingInvalid);
188     }
189
190     /**
191      * enable/disable xml
192      */

193     public void setIsXml(boolean value) {
194         isXml = String.valueOf(value);
195     }
196
197     /**
198      * enable/disable xml
199      */

200     public void setIsXml(String JavaDoc value) {
201         isXml = value;
202     }
203     
204     public String JavaDoc getIsXml() {
205         return isXml;
206     }
207     
208     /**
209      * return if is xml.
210      */

211     public boolean isXml() {
212     return getBoolean(isXml);
213     }
214
215     /**
216      * enable/disable deferredSyntaxAllowedAsLiteral
217      */

218     public void setDeferredSyntaxAllowedAsLiteral(boolean value) {
219         deferredSyntaxAllowedAsLiteral = String.valueOf(value);
220     }
221
222     /**
223      * enable/disable deferredSyntaxAllowedAsLiteral
224      */

225     public void setDeferredSyntaxAllowedAsLiteral(String JavaDoc value) {
226         deferredSyntaxAllowedAsLiteral = value;
227     }
228
229     public String JavaDoc getDeferredSyntaxAllowedAsLiteral() {
230         return deferredSyntaxAllowedAsLiteral;
231     }
232
233     /**
234      * return if is deferredSyntaxAllowedAsLiteral.
235      */

236     public boolean isDeferredSyntaxAllowedAsLiteral() {
237         return getBoolean(deferredSyntaxAllowedAsLiteral);
238     }
239
240     /**
241      * enable/disable trimDirectiveWhitespaces
242      */

243     public void setTrimDirectiveWhitespaces(boolean value) {
244         trimDirectiveWhitespaces = String.valueOf(value);
245     }
246
247     /**
248      * enable/disable trimDirectiveWhitespaces
249      */

250     public void setTrimDirectiveWhitespaces(String JavaDoc value) {
251         trimDirectiveWhitespaces = value;
252     }
253
254     public String JavaDoc getTrimDirectiveWhitespaces() {
255         return trimDirectiveWhitespaces;
256     }
257
258     /**
259      * return if is trimDirectiveWhitespaces.
260      */

261     public boolean isTrimDirectiveWhitespaces() {
262         return getBoolean(trimDirectiveWhitespaces);
263     }
264
265     
266     /**
267      * get display name.
268      */

269     public String JavaDoc getDisplayName() {
270         // bug#4745178 other code requires the
271
// display name to be localized.
272
return super.getName();
273     }
274
275     /**
276      * set display name.
277      */

278     public void setDisplayName(String JavaDoc name) {
279         // bug#4745178 other code requires the
280
// display name to be localized.
281
super.setName(name);
282     }
283
284     public String JavaDoc getPageEncoding() {
285     return pageEncoding;
286     }
287
288     public void setPageEncoding(String JavaDoc encoding) {
289     pageEncoding = encoding;
290     }
291
292     /**
293      * @return a string describing the values I hold
294      */

295     public void print(StringBuffer JavaDoc toStringBuffer) {
296         toStringBuffer.append("\n JspGroupDescriptor");
297     toStringBuffer.append( "\n");
298         super.print(toStringBuffer);
299     toStringBuffer.append( "\n DisplayName:").append(this.getDisplayName());
300     toStringBuffer.append( "\n PageEncoding:").append(pageEncoding);
301     toStringBuffer.append( "\n El-Ignored:").append(elIgnored);
302     toStringBuffer.append( "\n Scripting Invalid:").append(scriptingInvalid);
303     toStringBuffer.append( "\n urlPatterns: ").append(urlPatterns);
304     toStringBuffer.append( "\n includePreludes: ").append(includePreludes);
305     toStringBuffer.append( "\n includeCoda: ").append(includeCodas);
306     toStringBuffer.append( "\n Is XML:").append(isXml);
307     toStringBuffer.append( "\n DeferredSyntaxAllowedAsLiteral: ").append(deferredSyntaxAllowedAsLiteral);
308     toStringBuffer.append( "\n TrimDirectiveWhitespaces:").append(trimDirectiveWhitespaces);
309
310     }
311
312     private boolean getBoolean(String JavaDoc value) {
313         return Boolean.valueOf(value).booleanValue();
314     }
315 }
316
Popular Tags