Package org.codehaus.cargo.module.webapp
Class WebXmlIo
- java.lang.Object
-
- org.codehaus.cargo.module.AbstractDescriptorIo
-
- org.codehaus.cargo.module.webapp.WebXmlIo
-
- All Implemented Interfaces:
DescriptorIo
public final class WebXmlIo extends AbstractDescriptorIo
Provides convenience methods for reading and writing web deployment descriptors.
-
-
Constructor Summary
Constructors Constructor Description WebXmlIo(DescriptorType type)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected EntityResolver
getEntityResolver()
Get the default entity resolver for this type.static WebXml
newWebXml(WebXmlVersion theVersion)
Creates a new empty deployment descriptor.static WebXml
parseWebXml(InputStream theInput, EntityResolver theEntityResolver)
Parses a deployment descriptor provided as input stream.static WebXml
parseWebXmlFromFile(File theFile, EntityResolver theEntityResolver)
Parses a deployment descriptor stored in a regular file.-
Methods inherited from class org.codehaus.cargo.module.AbstractDescriptorIo
createDocumentBuilder, createDocumentBuilder, parseXml, parseXml, writeAll, writeDescriptor, writeDescriptor, writeDescriptor, writeDescriptor
-
-
-
-
Constructor Detail
-
WebXmlIo
public WebXmlIo(DescriptorType type)
Constructor.- Parameters:
type
- descriptor type
-
-
Method Detail
-
getEntityResolver
protected EntityResolver getEntityResolver()
Description copied from class:AbstractDescriptorIo
Get the default entity resolver for this type.- Overrides:
getEntityResolver
in classAbstractDescriptorIo
- Returns:
- the configured entity resolver
-
newWebXml
public static WebXml newWebXml(WebXmlVersion theVersion)
Creates a new empty deployment descriptor.- Parameters:
theVersion
- The version of the descriptor to create- Returns:
- The new descriptor
-
parseWebXmlFromFile
public static WebXml parseWebXmlFromFile(File theFile, EntityResolver theEntityResolver) throws IOException, org.jdom2.JDOMException
Parses a deployment descriptor stored in a regular file.- Parameters:
theFile
- The file to parsetheEntityResolver
- A SAX entity resolver, ornull
to use the default- Returns:
- The parsed descriptor
- Throws:
org.jdom2.JDOMException
- If the file could not be parsedIOException
- If an I/O error occurs
-
parseWebXml
public static WebXml parseWebXml(InputStream theInput, EntityResolver theEntityResolver) throws IOException, org.jdom2.JDOMException
Parses a deployment descriptor provided as input stream.- Parameters:
theInput
- The input streamtheEntityResolver
- A SAX entity resolver, ornull
to use the default- Returns:
- The parsed descriptor
- Throws:
IOException
- If an I/O error occursorg.jdom2.JDOMException
- If the input could not be parsed
-
-