KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > cactus > integration > ant > deployment > webapp > WebXmlTag


1 /*
2  * ========================================================================
3  *
4  * Copyright 2003 The Apache Software Foundation.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  * ========================================================================
19  */

20 package org.apache.cactus.integration.ant.deployment.webapp;
21
22 /**
23  * Represents the various top-level tags in a web deployment descriptor as a
24  * typesafe enumeration.
25  *
26  * @since Cactus 1.5
27  * @version $Id: WebXmlTag.java,v 1.1 2004/05/31 20:05:23 vmassol Exp $
28  */

29 public final class WebXmlTag
30 {
31     
32     // Public Constants --------------------------------------------------------
33

34     /**
35      * Element name 'icon'.
36      */

37     public static final WebXmlTag ICON =
38         new WebXmlTag("icon", false);
39     
40     /**
41      * Element name 'display-name'.
42      */

43     public static final WebXmlTag DISPLAY_NAME =
44         new WebXmlTag("display-name", false);
45     
46     /**
47      * Element name 'description'.
48      */

49     public static final WebXmlTag DESCRIPTION =
50         new WebXmlTag("description", false);
51     
52     /**
53      * Element name 'distributable'.
54      */

55     public static final WebXmlTag DISTRIBUTABLE =
56         new WebXmlTag("distributable", false);
57     
58     /**
59      * Element name 'context-param'.
60      */

61     public static final WebXmlTag CONTEXT_PARAM =
62         new WebXmlTag("context-param");
63     
64     /**
65      * Element name 'param-name'.
66      */

67     public static final WebXmlTag PARAM_NAME =
68         new WebXmlTag("param-name");
69     
70     /**
71      * Element name 'param-value'.
72      */

73     public static final WebXmlTag PARAM_VALUE =
74         new WebXmlTag("param-value");
75     
76     /**
77      * Element name 'filter'.
78      */

79     public static final WebXmlTag FILTER =
80         new WebXmlTag("filter");
81     
82     /**
83      * Element name 'filter-name'.
84      */

85     public static final WebXmlTag FILTER_NAME =
86         new WebXmlTag("filter-name");
87     
88     /**
89      * Element name 'filter-class'.
90      */

91     public static final WebXmlTag FILTER_CLASS =
92         new WebXmlTag("filter-class");
93     
94     /**
95      * Element name 'filter-mapping'.
96      */

97     public static final WebXmlTag FILTER_MAPPING =
98         new WebXmlTag("filter-mapping");
99     
100     /**
101      * Element name 'init-param'.
102      */

103     public static final WebXmlTag INIT_PARAM =
104         new WebXmlTag("init-param");
105     
106     /**
107      * Element name 'listener'.
108      */

109     public static final WebXmlTag LISTENER =
110         new WebXmlTag("listener");
111     
112     /**
113      * Element name 'servlet'.
114      */

115     public static final WebXmlTag SERVLET =
116         new WebXmlTag("servlet");
117     
118     /**
119      * Element name 'servlet-name'.
120      */

121     public static final WebXmlTag SERVLET_NAME =
122         new WebXmlTag("servlet-name");
123     
124     /**
125      * Element name 'jsp-file'.
126      */

127     public static final WebXmlTag JSP_FILE =
128         new WebXmlTag("jsp-file");
129     
130     /**
131      * Element name 'servlet-class'.
132      */

133     public static final WebXmlTag SERVLET_CLASS =
134         new WebXmlTag("servlet-class");
135     
136     /**
137      * Element name 'load-on-startup'.
138      */

139     public static final WebXmlTag LOAD_ON_STARTUP =
140         new WebXmlTag("load-on-startup");
141     
142     /**
143      * Element name 'servlet-mapping'.
144      */

145     public static final WebXmlTag SERVLET_MAPPING =
146         new WebXmlTag("servlet-mapping");
147     
148     /**
149      * Element name 'url-pattern'.
150      */

151     public static final WebXmlTag URL_PATTERN =
152         new WebXmlTag("url-pattern");
153     
154     /**
155      * Element name 'session-config'.
156      */

157     public static final WebXmlTag SESSION_CONFIG =
158         new WebXmlTag("session-config", false);
159     
160     /**
161      * Element name 'mime-mapping'.
162      */

163     public static final WebXmlTag MIME_MAPPING =
164         new WebXmlTag("mime-mapping");
165     
166     /**
167      * Element name 'welcome-file-list'.
168      */

169     public static final WebXmlTag WELCOME_FILE_LIST =
170         new WebXmlTag("welcome-file-list", false);
171     
172     /**
173      * Element name 'error-page'.
174      */

175     public static final WebXmlTag ERROR_PAGE =
176         new WebXmlTag("error-page");
177     
178     /**
179      * Element name 'taglib'.
180      */

181     public static final WebXmlTag TAGLIB =
182         new WebXmlTag("taglib");
183     
184     /**
185      * Element name 'resource-env-ref'.
186      */

187     public static final WebXmlTag RESOURCE_ENV_REF =
188         new WebXmlTag("resource-env-ref");
189     
190     /**
191      * Element name 'resource-ref'.
192      */

193     public static final WebXmlTag RESOURCE_REF =
194         new WebXmlTag("resource-ref");
195     
196     /**
197      * Element name 'security-constraint'.
198      */

199     public static final WebXmlTag SECURITY_CONSTRAINT =
200         new WebXmlTag("security-constraint");
201     
202     /**
203      * Element name 'web-resource-collection'.
204      */

205     public static final WebXmlTag WEB_RESOURCE_COLLECTION =
206         new WebXmlTag("web-resource-collection");
207     
208     /**
209      * Element name 'web-resource-name'.
210      */

211     public static final WebXmlTag WEB_RESOURCE_NAME =
212         new WebXmlTag("web-resource-name");
213     
214     /**
215      * Element name 'auth-constraint'.
216      */

217     public static final WebXmlTag AUTH_CONSTRAINT =
218         new WebXmlTag("auth-constraint");
219     
220     /**
221      * Element name 'login-config'.
222      */

223     public static final WebXmlTag LOGIN_CONFIG =
224         new WebXmlTag("login-config", false);
225     
226     /**
227      * Element name 'auth-method'.
228      */

229     public static final WebXmlTag AUTH_METHOD =
230         new WebXmlTag("auth-method");
231
232     /**
233      * Element name 'realm-name'.
234      */

235     public static final WebXmlTag REALM_NAME =
236         new WebXmlTag("realm-name");
237
238     /**
239      * Element name 'security-role'.
240      */

241     public static final WebXmlTag SECURITY_ROLE =
242         new WebXmlTag("security-role");
243     
244     /**
245      * Element name 'role-name'.
246      */

247     public static final WebXmlTag ROLE_NAME =
248         new WebXmlTag("role-name");
249     
250     /**
251      * Element name 'env-entry'.
252      */

253     public static final WebXmlTag ENV_ENTRY =
254         new WebXmlTag("env-entry");
255     
256     /**
257      * Element name 'ejb-ref'.
258      */

259     public static final WebXmlTag EJB_REF =
260         new WebXmlTag("ejb-ref");
261     
262     /**
263      * Element name 'ejb-local-ref'.
264      */

265     public static final WebXmlTag EJB_LOCAL_REF =
266         new WebXmlTag("ejb-local-ref");
267     
268     // Instance Variables ------------------------------------------------------
269

270     /**
271      * The tag name,
272      */

273     private String JavaDoc tagName;
274     
275     /**
276      * Whether multiple occurrences of the tag in the descriptor are allowed.
277      */

278     private boolean multipleAllowed;
279     
280     // Constructors ------------------------------------------------------------
281

282     /**
283      * Constructor.
284      *
285      * @param theTagName The tag name of the element
286      * @param isMultipleAllowed Whether the element may occur multiple times in
287      * the descriptor
288      */

289     private WebXmlTag(String JavaDoc theTagName, boolean isMultipleAllowed)
290     {
291         this.tagName = theTagName;
292         this.multipleAllowed = isMultipleAllowed;
293     }
294
295     /**
296      * Constructor.
297      *
298      * @param theTagName The tag name of the element
299      */

300     private WebXmlTag(String JavaDoc theTagName)
301     {
302         this(theTagName, true);
303     }
304
305     // Public Methods ----------------------------------------------------------
306

307     /**
308      * @see java.lang.Object#toString
309      */

310     public boolean equals(Object JavaDoc theOther)
311     {
312         return super.equals(theOther);
313     }
314     
315     /**
316      * @see java.lang.Object#hashCode
317      */

318     public int hashCode()
319     {
320         return super.hashCode();
321     }
322     
323     /**
324      * Returns the tag name.
325      *
326      * @return The tag name
327      */

328     public String JavaDoc getTagName()
329     {
330         return this.tagName;
331     }
332     
333     /**
334      * Returns whether the tag may occur multiple times in the descriptor.
335      *
336      * @return Whether multiple occurrences are allowed
337      */

338     public boolean isMultipleAllowed()
339     {
340         return this.multipleAllowed;
341     }
342     
343     /**
344      * @see java.lang.Object#toString
345      */

346     public String JavaDoc toString()
347     {
348         return getTagName();
349     }
350     
351 }
352
Popular Tags