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 WebXmlVersion
version
The 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 WebXmlVersion
getVersion()
Get the version that was determined.void
notationDecl(String namespaceURI, String sName, String qName)
.WebXml
parse()
Perform the parsing of the passed stream, and return a Web XML from the contents.void
startElement(String namespaceURI, String sName, String qName, Attributes attrs)
void
unparsedEntityDecl(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:
notationDecl
in interfaceDTDHandler
- Overrides:
notationDecl
in classDefaultHandler
- Throws:
SAXException
-
unparsedEntityDecl
public void unparsedEntityDecl(String arg0, String arg1, String arg2, String arg3) throws SAXException
. This is an empty implementation.- Specified by:
unparsedEntityDecl
in interfaceDTDHandler
- Overrides:
unparsedEntityDecl
in classDefaultHandler
- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String sName, String qName, Attributes attrs) throws SAXException
- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
getVersion
public WebXmlVersion getVersion()
Get the version that was determined.- Returns:
- the version.
-
-