org.codehaus.cargo.module.webapp
Class WebXmlTypeAwareParser

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.codehaus.cargo.module.webapp.WebXmlTypeAwareParser
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class WebXmlTypeAwareParser
extends org.xml.sax.helpers.DefaultHandler

SAX Handler for working out what the type of a web descriptor is.

Version:
$Id: WebXmlTypeAwareParser.java 1705 2008-09-02 13:14:55Z adriana $

Field Summary
protected  WebXmlVersion version
          The version that we think the XML data is.
 
Constructor Summary
WebXmlTypeAwareParser(java.io.InputStream theInput, org.xml.sax.EntityResolver theEntityResolver)
          Constructor.
 
Method Summary
 WebXmlVersion getVersion()
          Get the version that was determined.
 void notationDecl(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName)
          
 WebXml parse()
          Perform the parsing of the passed stream, and return a Web XML from the contents.
 void startElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName, org.xml.sax.Attributes attrs)
          
 void unparsedEntityDecl(java.lang.String arg0, java.lang.String arg1, java.lang.String arg2, java.lang.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

protected WebXmlVersion version
The version that we think the XML data is.

Constructor Detail

WebXmlTypeAwareParser

public WebXmlTypeAwareParser(java.io.InputStream theInput,
                             org.xml.sax.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 from
theEntityResolver - entity resolver to use
Method Detail

parse

public WebXml parse()
             throws java.io.IOException,
                    org.jdom.JDOMException
Perform the parsing of the passed stream, and return a Web XML from the contents.

Returns:
WebXml
Throws:
java.io.IOException - if there is a problem reading the stream
org.jdom.JDOMException - if there is an XML problem

notationDecl

public void notationDecl(java.lang.String namespaceURI,
                         java.lang.String sName,
                         java.lang.String qName)
                  throws org.xml.sax.SAXException

Specified by:
notationDecl in interface org.xml.sax.DTDHandler
Overrides:
notationDecl in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

unparsedEntityDecl

public void unparsedEntityDecl(java.lang.String arg0,
                               java.lang.String arg1,
                               java.lang.String arg2,
                               java.lang.String arg3)
                        throws org.xml.sax.SAXException

Specified by:
unparsedEntityDecl in interface org.xml.sax.DTDHandler
Overrides:
unparsedEntityDecl in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String sName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attrs)
                  throws org.xml.sax.SAXException

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

getVersion

public WebXmlVersion getVersion()
Get the version that was determined.

Returns:
the version.


Copyright © 2004-2011 Codehaus. All Rights Reserved.