org.codehaus.cargo.module.webapp
Class WebXmlVersion

java.lang.Object
  extended by org.codehaus.cargo.module.webapp.WebXmlVersion
All Implemented Interfaces:
java.lang.Comparable

public final class WebXmlVersion
extends java.lang.Object
implements java.lang.Comparable

Enumerated type that represents the version of the web deployment descriptor.

Version:
$Id: WebXmlVersion.java 1705 2008-09-02 13:14:55Z adriana $

Field Summary
static WebXmlVersion V2_2
          Instance for version 2.2.
static WebXmlVersion V2_3
          Instance for version 2.3.
static WebXmlVersion V2_4
          Instance for version 2.4.
static WebXmlVersion V2_5
          Instance for version 2.5.
 
Method Summary
 int compareTo(java.lang.Object other)
          
 org.jdom.Namespace getNamespace()
          Return the namespace of this web xml file, or null if none.
 java.lang.String getPublicId()
          Returns the public ID of the document type corresponding to the descriptor version.
 java.lang.String getSystemId()
          Returns the system ID of the document type corresponding to the descriptor version.
 java.lang.String getVersion()
          Returns the tag name.
 java.lang.String toString()
          
static WebXmlVersion valueOf(org.jdom.DocType theDocType)
          Returns the version corresponding to the given document type.
static WebXmlVersion valueOf(org.jdom.Element rootElement)
          Returns the version corresponding to the given element.
static WebXmlVersion valueOf(java.lang.String thePublicId)
          Returns the version corresponding to the given public ID.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

V2_2

public static final WebXmlVersion V2_2
Instance for version 2.2.


V2_3

public static final WebXmlVersion V2_3
Instance for version 2.3.


V2_4

public static final WebXmlVersion V2_4
Instance for version 2.4.


V2_5

public static final WebXmlVersion V2_5
Instance for version 2.5.

Method Detail

compareTo

public int compareTo(java.lang.Object other)

Specified by:
compareTo in interface java.lang.Comparable
See Also:
Comparable.compareTo(T)

getVersion

public java.lang.String getVersion()
Returns the tag name.

Returns:
The tag name

getPublicId

public java.lang.String getPublicId()
Returns the public ID of the document type corresponding to the descriptor version.

Returns:
The public ID

getSystemId

public java.lang.String getSystemId()
Returns the system ID of the document type corresponding to the descriptor version.

Returns:
The system ID

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

valueOf

public static WebXmlVersion valueOf(org.jdom.DocType theDocType)
                             throws java.lang.NullPointerException
Returns the version corresponding to the given document type.

Parameters:
theDocType - The document type
Returns:
The version that matches the document type, or null if the doctype is not recognized
Throws:
java.lang.NullPointerException - If the document type is null

valueOf

public static WebXmlVersion valueOf(org.jdom.Element rootElement)
Returns the version corresponding to the given element.

Parameters:
rootElement - The element
Returns:
The version that matches the element

valueOf

public static WebXmlVersion valueOf(java.lang.String thePublicId)
Returns the version corresponding to the given public ID.

Parameters:
thePublicId - The public ID
Returns:
The version that matches the public ID, or null if the ID is not recognized

getNamespace

public org.jdom.Namespace getNamespace()
Return the namespace of this web xml file, or null if none.

Returns:
namespace


Copyright © 2004-2011 Codehaus. All Rights Reserved.