Package org.codehaus.cargo.module.webapp
Class WebXmlVersion
- java.lang.Object
-
- org.codehaus.cargo.module.webapp.WebXmlVersion
-
- All Implemented Interfaces:
Comparable<WebXmlVersion>
public final class WebXmlVersion extends Object implements Comparable<WebXmlVersion>
Enumerated type that represents the version of the web deployment descriptor.
-
-
Field Summary
Fields Modifier and Type Field Description 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.static WebXmlVersion
V3_0
Instance for version 3.0.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(WebXmlVersion other)
org.jdom2.Namespace
getNamespace()
Return the namespace of this web xml file, or null if none.String
getPublicId()
Returns the public ID of the document type corresponding to the descriptor version.String
getSystemId()
Returns the system ID of the document type corresponding to the descriptor version.String
getVersion()
Returns the tag name.String
toString()
static WebXmlVersion
valueOf(String thePublicId)
Returns the version corresponding to the given public ID.static WebXmlVersion
valueOf(org.jdom2.DocType theDocType)
Returns the version corresponding to the given document type.static WebXmlVersion
valueOf(org.jdom2.Element rootElement)
Returns the version corresponding to the given element.
-
-
-
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.
-
V3_0
public static final WebXmlVersion V3_0
Instance for version 3.0.
-
-
Method Detail
-
compareTo
public int compareTo(WebXmlVersion other)
- Specified by:
compareTo
in interfaceComparable<WebXmlVersion>
-
getVersion
public String getVersion()
Returns the tag name.- Returns:
- The tag name
-
getPublicId
public String getPublicId()
Returns the public ID of the document type corresponding to the descriptor version.- Returns:
- The public ID
-
getSystemId
public String getSystemId()
Returns the system ID of the document type corresponding to the descriptor version.- Returns:
- The system ID
-
valueOf
public static WebXmlVersion valueOf(org.jdom2.DocType theDocType) throws 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:
NullPointerException
- If the document type isnull
-
valueOf
public static WebXmlVersion valueOf(org.jdom2.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(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.jdom2.Namespace getNamespace()
Return the namespace of this web xml file, or null if none.- Returns:
- namespace
-
-