org.codehaus.cargo.module.webapp
Class WebXmlIo

java.lang.Object
  extended by org.codehaus.cargo.module.AbstractDescriptorIo
      extended by org.codehaus.cargo.module.webapp.WebXmlIo

public final class WebXmlIo
extends AbstractDescriptorIo

Provides convenience methods for reading and writing web deployment descriptors.

Version:
$Id: WebXmlIo.java 1088 2006-07-15 19:37:00Z vmassol $

Method Summary
static WebXml newWebXml(WebXmlVersion theVersion)
          Creates a new empty deployment descriptor.
static WebXml parseWebXml(java.io.InputStream theInput, org.xml.sax.EntityResolver theEntityResolver)
          Parses a deployment descriptor provided as input stream.
static WebXml parseWebXmlFromFile(java.io.File theFile, org.xml.sax.EntityResolver theEntityResolver)
          Parses a deployment descriptor stored in a regular file.
 
Methods inherited from class org.codehaus.cargo.module.AbstractDescriptorIo
createDocumentBuilder, writeAll, writeDescriptor, writeDescriptor, writeDescriptor, writeDescriptor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newWebXml

public static WebXml newWebXml(WebXmlVersion theVersion)
                        throws javax.xml.parsers.ParserConfigurationException
Creates a new empty deployment descriptor.

Parameters:
theVersion - The version of the descriptor to create
Returns:
The new descriptor
Throws:
javax.xml.parsers.ParserConfigurationException - If the XML parser was not correctly configured

parseWebXmlFromFile

public static WebXml parseWebXmlFromFile(java.io.File theFile,
                                         org.xml.sax.EntityResolver theEntityResolver)
                                  throws org.xml.sax.SAXException,
                                         javax.xml.parsers.ParserConfigurationException,
                                         java.io.IOException
Parses a deployment descriptor stored in a regular file.

Parameters:
theFile - The file to parse
theEntityResolver - A SAX entity resolver, or null to use the default
Returns:
The parsed descriptor
Throws:
org.xml.sax.SAXException - If the file could not be parsed
javax.xml.parsers.ParserConfigurationException - If the XML parser was not correctly configured
java.io.IOException - If an I/O error occurs

parseWebXml

public static WebXml parseWebXml(java.io.InputStream theInput,
                                 org.xml.sax.EntityResolver theEntityResolver)
                          throws org.xml.sax.SAXException,
                                 javax.xml.parsers.ParserConfigurationException,
                                 java.io.IOException
Parses a deployment descriptor provided as input stream.

Parameters:
theInput - The input stream
theEntityResolver - A SAX entity resolver, or null to use the default
Returns:
The parsed descriptor
Throws:
org.xml.sax.SAXException - If the input could not be parsed
javax.xml.parsers.ParserConfigurationException - If the XML parser was not correctly configured
java.io.IOException - If an I/O error occurs


Copyright © 2004-2011 Codehaus. All Rights Reserved.