Package org.codehaus.cargo.module.webapp
Class WebXmlTypeAwareParser
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- org.codehaus.cargo.module.webapp.WebXmlTypeAwareParser
-
- All Implemented Interfaces:
ContentHandler,DTDHandler,EntityResolver,ErrorHandler
public class WebXmlTypeAwareParser extends DefaultHandler
SAX Handler for working out what the type of a web descriptor is.
-
-
Field Summary
Fields Modifier and Type Field Description protected WebXmlVersionversionThe version that we think the XML data is.
-
Constructor Summary
Constructors Constructor Description WebXmlTypeAwareParser(InputStream theInput, EntityResolver theEntityResolver)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WebXmlVersiongetVersion()Get the version that was determined.voidnotationDecl(String namespaceURI, String sName, String qName).WebXmlparse()Perform the parsing of the passed stream, and return a Web XML from the contents.voidstartElement(String namespaceURI, String sName, String qName, Attributes attrs)voidunparsedEntityDecl(String arg0, String arg1, String arg2, String arg3).-
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, warning
-
-
-
-
Field Detail
-
version
protected WebXmlVersion version
The version that we think the XML data is.
-
-
Constructor Detail
-
WebXmlTypeAwareParser
public WebXmlTypeAwareParser(InputStream theInput, EntityResolver theEntityResolver)
Constructor. Make a Web XML parser which will generate a web xml of the correct type, by examining the stream.- Parameters:
theInput- stream to read fromtheEntityResolver- entity resolver to use
-
-
Method Detail
-
parse
public WebXml parse() throws IOException, org.jdom2.JDOMException
Perform the parsing of the passed stream, and return a Web XML from the contents.- Returns:
- WebXml
- Throws:
IOException- if there is a problem reading the streamorg.jdom2.JDOMException- if there is an XML problem
-
notationDecl
public void notationDecl(String namespaceURI, String sName, String qName) throws SAXException
. This is an empty implementation.- Specified by:
notationDeclin interfaceDTDHandler- Overrides:
notationDeclin classDefaultHandler- Throws:
SAXException
-
unparsedEntityDecl
public void unparsedEntityDecl(String arg0, String arg1, String arg2, String arg3) throws SAXException
. This is an empty implementation.- Specified by:
unparsedEntityDeclin interfaceDTDHandler- Overrides:
unparsedEntityDeclin classDefaultHandler- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String sName, String qName, Attributes attrs) throws SAXException
- Specified by:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
getVersion
public WebXmlVersion getVersion()
Get the version that was determined.- Returns:
- the version.
-
-