|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| WebXmlTag.java | - | 62.5% | 57.1% | 60% |
|
||||||||||||||
| 1 |
/*
|
|
| 2 |
* ====================================================================
|
|
| 3 |
*
|
|
| 4 |
* The Apache Software License, Version 1.1
|
|
| 5 |
*
|
|
| 6 |
* Copyright (c) 2003 The Apache Software Foundation. All rights
|
|
| 7 |
* reserved.
|
|
| 8 |
*
|
|
| 9 |
* Redistribution and use in source and binary forms, with or without
|
|
| 10 |
* modification, are permitted provided that the following conditions
|
|
| 11 |
* are met:
|
|
| 12 |
*
|
|
| 13 |
* 1. Redistributions of source code must retain the above copyright
|
|
| 14 |
* notice, this list of conditions and the following disclaimer.
|
|
| 15 |
*
|
|
| 16 |
* 2. Redistributions in binary form must reproduce the above copyright
|
|
| 17 |
* notice, this list of conditions and the following disclaimer in
|
|
| 18 |
* the documentation and/or other materials provided with the
|
|
| 19 |
* distribution.
|
|
| 20 |
*
|
|
| 21 |
* 3. The end-user documentation included with the redistribution, if
|
|
| 22 |
* any, must include the following acknowlegement:
|
|
| 23 |
* "This product includes software developed by the
|
|
| 24 |
* Apache Software Foundation (http://www.apache.org/)."
|
|
| 25 |
* Alternately, this acknowlegement may appear in the software itself,
|
|
| 26 |
* if and wherever such third-party acknowlegements normally appear.
|
|
| 27 |
*
|
|
| 28 |
* 4. The names "The Jakarta Project", "Cactus" and "Apache Software
|
|
| 29 |
* Foundation" must not be used to endorse or promote products
|
|
| 30 |
* derived from this software without prior written permission. For
|
|
| 31 |
* written permission, please contact apache@apache.org.
|
|
| 32 |
*
|
|
| 33 |
* 5. Products derived from this software may not be called "Apache"
|
|
| 34 |
* nor may "Apache" appear in their names without prior written
|
|
| 35 |
* permission of the Apache Group.
|
|
| 36 |
*
|
|
| 37 |
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
|
|
| 38 |
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
| 39 |
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
| 40 |
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
|
|
| 41 |
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
| 42 |
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
|
| 43 |
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
|
| 44 |
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
| 45 |
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
| 46 |
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
|
|
| 47 |
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
| 48 |
* SUCH DAMAGE.
|
|
| 49 |
* ====================================================================
|
|
| 50 |
*
|
|
| 51 |
* This software consists of voluntary contributions made by many
|
|
| 52 |
* individuals on behalf of the Apache Software Foundation. For more
|
|
| 53 |
* information on the Apache Software Foundation, please see
|
|
| 54 |
* <http://www.apache.org/>.
|
|
| 55 |
*
|
|
| 56 |
*/
|
|
| 57 |
package org.apache.cactus.integration.ant.deployment;
|
|
| 58 |
|
|
| 59 |
/**
|
|
| 60 |
* Represents the various top-level tags in a web deployment descriptor as a
|
|
| 61 |
* typesafe enumeration.
|
|
| 62 |
*
|
|
| 63 |
* @author <a href="mailto:cmlenz@apache.org">Christopher Lenz</a>
|
|
| 64 |
*
|
|
| 65 |
* @since Cactus 1.5
|
|
| 66 |
* @version $Id: WebXmlTag.java,v 1.7.2.3 2003/10/23 18:20:45 vmassol Exp $
|
|
| 67 |
*/
|
|
| 68 |
public final class WebXmlTag |
|
| 69 |
{
|
|
| 70 |
|
|
| 71 |
// Public Constants --------------------------------------------------------
|
|
| 72 |
|
|
| 73 |
/**
|
|
| 74 |
* Element name 'icon'.
|
|
| 75 |
*/
|
|
| 76 |
public static final WebXmlTag ICON = |
|
| 77 |
new WebXmlTag("icon", false); |
|
| 78 |
|
|
| 79 |
/**
|
|
| 80 |
* Element name 'display-name'.
|
|
| 81 |
*/
|
|
| 82 |
public static final WebXmlTag DISPLAY_NAME = |
|
| 83 |
new WebXmlTag("display-name", false); |
|
| 84 |
|
|
| 85 |
/**
|
|
| 86 |
* Element name 'description'.
|
|
| 87 |
*/
|
|
| 88 |
public static final WebXmlTag DESCRIPTION = |
|
| 89 |
new WebXmlTag("description", false); |
|
| 90 |
|
|
| 91 |
/**
|
|
| 92 |
* Element name 'distributable'.
|
|
| 93 |
*/
|
|
| 94 |
public static final WebXmlTag DISTRIBUTABLE = |
|
| 95 |
new WebXmlTag("distributable", false); |
|
| 96 |
|
|
| 97 |
/**
|
|
| 98 |
* Element name 'context-param'.
|
|
| 99 |
*/
|
|
| 100 |
public static final WebXmlTag CONTEXT_PARAM = |
|
| 101 |
new WebXmlTag("context-param"); |
|
| 102 |
|
|
| 103 |
/**
|
|
| 104 |
* Element name 'param-name'.
|
|
| 105 |
*/
|
|
| 106 |
public static final WebXmlTag PARAM_NAME = |
|
| 107 |
new WebXmlTag("param-name"); |
|
| 108 |
|
|
| 109 |
/**
|
|
| 110 |
* Element name 'param-value'.
|
|
| 111 |
*/
|
|
| 112 |
public static final WebXmlTag PARAM_VALUE = |
|
| 113 |
new WebXmlTag("param-value"); |
|
| 114 |
|
|
| 115 |
/**
|
|
| 116 |
* Element name 'filter'.
|
|
| 117 |
*/
|
|
| 118 |
public static final WebXmlTag FILTER = |
|
| 119 |
new WebXmlTag("filter"); |
|
| 120 |
|
|
| 121 |
/**
|
|
| 122 |
* Element name 'filter-name'.
|
|
| 123 |
*/
|
|
| 124 |
public static final WebXmlTag FILTER_NAME = |
|
| 125 |
new WebXmlTag("filter-name"); |
|
| 126 |
|
|
| 127 |
/**
|
|
| 128 |
* Element name 'filter-class'.
|
|
| 129 |
*/
|
|
| 130 |
public static final WebXmlTag FILTER_CLASS = |
|
| 131 |
new WebXmlTag("filter-class"); |
|
| 132 |
|
|
| 133 |
/**
|
|
| 134 |
* Element name 'filter-mapping'.
|
|
| 135 |
*/
|
|
| 136 |
public static final WebXmlTag FILTER_MAPPING = |
|
| 137 |
new WebXmlTag("filter-mapping"); |
|
| 138 |
|
|
| 139 |
/**
|
|
| 140 |
* Element name 'init-param'.
|
|
| 141 |
*/
|
|
| 142 |
public static final WebXmlTag INIT_PARAM = |
|
| 143 |
new WebXmlTag("init-param"); |
|
| 144 |
|
|
| 145 |
/**
|
|
| 146 |
* Element name 'listener'.
|
|
| 147 |
*/
|
|
| 148 |
public static final WebXmlTag LISTENER = |
|
| 149 |
new WebXmlTag("listener"); |
|
| 150 |
|
|
| 151 |
/**
|
|
| 152 |
* Element name 'servlet'.
|
|
| 153 |
*/
|
|
| 154 |
public static final WebXmlTag SERVLET = |
|
| 155 |
new WebXmlTag("servlet"); |
|
| 156 |
|
|
| 157 |
/**
|
|
| 158 |
* Element name 'servlet-name'.
|
|
| 159 |
*/
|
|
| 160 |
public static final WebXmlTag SERVLET_NAME = |
|
| 161 |
new WebXmlTag("servlet-name"); |
|
| 162 |
|
|
| 163 |
/**
|
|
| 164 |
* Element name 'jsp-file'.
|
|
| 165 |
*/
|
|
| 166 |
public static final WebXmlTag JSP_FILE = |
|
| 167 |
new WebXmlTag("jsp-file"); |
|
| 168 |
|
|
| 169 |
/**
|
|
| 170 |
* Element name 'servlet-class'.
|
|
| 171 |
*/
|
|
| 172 |
public static final WebXmlTag SERVLET_CLASS = |
|
| 173 |
new WebXmlTag("servlet-class"); |
|
| 174 |
|
|
| 175 |
/**
|
|
| 176 |
* Element name 'load-on-startup'.
|
|
| 177 |
*/
|
|
| 178 |
public static final WebXmlTag LOAD_ON_STARTUP = |
|
| 179 |
new WebXmlTag("load-on-startup"); |
|
| 180 |
|
|
| 181 |
/**
|
|
| 182 |
* Element name 'servlet-mapping'.
|
|
| 183 |
*/
|
|
| 184 |
public static final WebXmlTag SERVLET_MAPPING = |
|
| 185 |
new WebXmlTag("servlet-mapping"); |
|
| 186 |
|
|
| 187 |
/**
|
|
| 188 |
* Element name 'url-pattern'.
|
|
| 189 |
*/
|
|
| 190 |
public static final WebXmlTag URL_PATTERN = |
|
| 191 |
new WebXmlTag("url-pattern"); |
|
| 192 |
|
|
| 193 |
/**
|
|
| 194 |
* Element name 'session-config'.
|
|
| 195 |
*/
|
|
| 196 |
public static final WebXmlTag SESSION_CONFIG = |
|
| 197 |
new WebXmlTag("session-config", false); |
|
| 198 |
|
|
| 199 |
/**
|
|
| 200 |
* Element name 'mime-mapping'.
|
|
| 201 |
*/
|
|
| 202 |
public static final WebXmlTag MIME_MAPPING = |
|
| 203 |
new WebXmlTag("mime-mapping"); |
|
| 204 |
|
|
| 205 |
/**
|
|
| 206 |
* Element name 'welcome-file-list'.
|
|
| 207 |
*/
|
|
| 208 |
public static final WebXmlTag WELCOME_FILE_LIST = |
|
| 209 |
new WebXmlTag("welcome-file-list", false); |
|
| 210 |
|
|
| 211 |
/**
|
|
| 212 |
* Element name 'error-page'.
|
|
| 213 |
*/
|
|
| 214 |
public static final WebXmlTag ERROR_PAGE = |
|
| 215 |
new WebXmlTag("error-page"); |
|
| 216 |
|
|
| 217 |
/**
|
|
| 218 |
* Element name 'taglib'.
|
|
| 219 |
*/
|
|
| 220 |
public static final WebXmlTag TAGLIB = |
|
| 221 |
new WebXmlTag("taglib"); |
|
| 222 |
|
|
| 223 |
/**
|
|
| 224 |
* Element name 'resource-env-ref'.
|
|
| 225 |
*/
|
|
| 226 |
public static final WebXmlTag RESOURCE_ENV_REF = |
|
| 227 |
new WebXmlTag("resource-env-ref"); |
|
| 228 |
|
|
| 229 |
/**
|
|
| 230 |
* Element name 'resource-ref'.
|
|
| 231 |
*/
|
|
| 232 |
public static final WebXmlTag RESOURCE_REF = |
|
| 233 |
new WebXmlTag("resource-ref"); |
|
| 234 |
|
|
| 235 |
/**
|
|
| 236 |
* Element name 'security-constraint'.
|
|
| 237 |
*/
|
|
| 238 |
public static final WebXmlTag SECURITY_CONSTRAINT = |
|
| 239 |
new WebXmlTag("security-constraint"); |
|
| 240 |
|
|
| 241 |
/**
|
|
| 242 |
* Element name 'web-resource-collection'.
|
|
| 243 |
*/
|
|
| 244 |
public static final WebXmlTag WEB_RESOURCE_COLLECTION = |
|
| 245 |
new WebXmlTag("web-resource-collection"); |
|
| 246 |
|
|
| 247 |
/**
|
|
| 248 |
* Element name 'web-resource-name'.
|
|
| 249 |
*/
|
|
| 250 |
public static final WebXmlTag WEB_RESOURCE_NAME = |
|
| 251 |
new WebXmlTag("web-resource-name"); |
|
| 252 |
|
|
| 253 |
/**
|
|
| 254 |
* Element name 'auth-constraint'.
|
|
| 255 |
*/
|
|
| 256 |
public static final WebXmlTag AUTH_CONSTRAINT = |
|
| 257 |
new WebXmlTag("auth-constraint"); |
|
| 258 |
|
|
| 259 |
/**
|
|
| 260 |
* Element name 'login-config'.
|
|
| 261 |
*/
|
|
| 262 |
public static final WebXmlTag LOGIN_CONFIG = |
|
| 263 |
new WebXmlTag("login-config", false); |
|
| 264 |
|
|
| 265 |
/**
|
|
| 266 |
* Element name 'auth-method'.
|
|
| 267 |
*/
|
|
| 268 |
public static final WebXmlTag AUTH_METHOD = |
|
| 269 |
new WebXmlTag("auth-method"); |
|
| 270 |
|
|
| 271 |
/**
|
|
| 272 |
* Element name 'realm-name'.
|
|
| 273 |
*/
|
|
| 274 |
public static final WebXmlTag REALM_NAME = |
|
| 275 |
new WebXmlTag("realm-name"); |
|
| 276 |
|
|
| 277 |
/**
|
|
| 278 |
* Element name 'security-role'.
|
|
| 279 |
*/
|
|
| 280 |
public static final WebXmlTag SECURITY_ROLE = |
|
| 281 |
new WebXmlTag("security-role"); |
|
| 282 |
|
|
| 283 |
/**
|
|
| 284 |
* Element name 'role-name'.
|
|
| 285 |
*/
|
|
| 286 |
public static final WebXmlTag ROLE_NAME = |
|
| 287 |
new WebXmlTag("role-name"); |
|
| 288 |
|
|
| 289 |
/**
|
|
| 290 |
* Element name 'env-entry'.
|
|
| 291 |
*/
|
|
| 292 |
public static final WebXmlTag ENV_ENTRY = |
|
| 293 |
new WebXmlTag("env-entry"); |
|
| 294 |
|
|
| 295 |
/**
|
|
| 296 |
* Element name 'ejb-ref'.
|
|
| 297 |
*/
|
|
| 298 |
public static final WebXmlTag EJB_REF = |
|
| 299 |
new WebXmlTag("ejb-ref"); |
|
| 300 |
|
|
| 301 |
/**
|
|
| 302 |
* Element name 'ejb-local-ref'.
|
|
| 303 |
*/
|
|
| 304 |
public static final WebXmlTag EJB_LOCAL_REF = |
|
| 305 |
new WebXmlTag("ejb-local-ref"); |
|
| 306 |
|
|
| 307 |
// Instance Variables ------------------------------------------------------
|
|
| 308 |
|
|
| 309 |
/**
|
|
| 310 |
* The tag name,
|
|
| 311 |
*/
|
|
| 312 |
private String tagName;
|
|
| 313 |
|
|
| 314 |
/**
|
|
| 315 |
* Whether multiple occurrences of the tag in the descriptor are allowed.
|
|
| 316 |
*/
|
|
| 317 |
private boolean multipleAllowed; |
|
| 318 |
|
|
| 319 |
// Constructors ------------------------------------------------------------
|
|
| 320 |
|
|
| 321 |
/**
|
|
| 322 |
* Constructor.
|
|
| 323 |
*
|
|
| 324 |
* @param theTagName The tag name of the element
|
|
| 325 |
* @param isMultipleAllowed Whether the element may occur multiple times in
|
|
| 326 |
* the descriptor
|
|
| 327 |
*/
|
|
| 328 | 195 |
private WebXmlTag(String theTagName, boolean isMultipleAllowed) |
| 329 |
{
|
|
| 330 | 195 |
this.tagName = theTagName;
|
| 331 | 195 |
this.multipleAllowed = isMultipleAllowed;
|
| 332 |
} |
|
| 333 |
|
|
| 334 |
/**
|
|
| 335 |
* Constructor.
|
|
| 336 |
*
|
|
| 337 |
* @param theTagName The tag name of the element
|
|
| 338 |
*/
|
|
| 339 | 160 |
private WebXmlTag(String theTagName)
|
| 340 |
{
|
|
| 341 | 160 |
this(theTagName, true); |
| 342 |
} |
|
| 343 |
|
|
| 344 |
// Public Methods ----------------------------------------------------------
|
|
| 345 |
|
|
| 346 |
/**
|
|
| 347 |
* @see java.lang.Object#toString
|
|
| 348 |
*/
|
|
| 349 | 0 |
public boolean equals(Object theOther) |
| 350 |
{
|
|
| 351 | 0 |
return super.equals(theOther); |
| 352 |
} |
|
| 353 |
|
|
| 354 |
/**
|
|
| 355 |
* @see java.lang.Object#hashCode
|
|
| 356 |
*/
|
|
| 357 | 0 |
public int hashCode() |
| 358 |
{
|
|
| 359 | 0 |
return super.hashCode(); |
| 360 |
} |
|
| 361 |
|
|
| 362 |
/**
|
|
| 363 |
* Returns the tag name.
|
|
| 364 |
*
|
|
| 365 |
* @return The tag name
|
|
| 366 |
*/
|
|
| 367 | 2945 |
public String getTagName()
|
| 368 |
{
|
|
| 369 | 2945 |
return this.tagName; |
| 370 |
} |
|
| 371 |
|
|
| 372 |
/**
|
|
| 373 |
* Returns whether the tag may occur multiple times in the descriptor.
|
|
| 374 |
*
|
|
| 375 |
* @return Whether multiple occurrences are allowed
|
|
| 376 |
*/
|
|
| 377 | 137 |
public boolean isMultipleAllowed() |
| 378 |
{
|
|
| 379 | 137 |
return this.multipleAllowed; |
| 380 |
} |
|
| 381 |
|
|
| 382 |
/**
|
|
| 383 |
* @see java.lang.Object#toString
|
|
| 384 |
*/
|
|
| 385 | 0 |
public String toString()
|
| 386 |
{
|
|
| 387 | 0 |
return getTagName();
|
| 388 |
} |
|
| 389 |
|
|
| 390 |
} |
|
| 391 |
|
|
||||||||||