org.jcommando
Class SAXHandler

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byorg.jcommando.SAXHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

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

Author:
Brett Wooldridge

Method Summary
 void characters(char[] ch, int start, int length)
          Overloaded method.
 void endDocument()
          This method is called by the SAX parser when the end of document is reached.
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          Overloaded method.
 void fatalError(org.xml.sax.SAXParseException e)
          Overloaded method.
 void startDocument()
          Overloaded method.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
          Overloaded method.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Overloaded method.

Throws:
org.xml.sax.SAXException - thrown if there is a parsing error
See Also:
ContentHandler.startDocument()

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attributes)
                  throws org.xml.sax.SAXException
Overloaded method.

Parameters:
uri - a SAX imposed parameter representing a URI to the XML input file
localName - a namespace parameter
qName - the name of the current XML element
attributes - a collection of element attribute objects
Throws:
org.xml.sax.SAXException - thrown if there is a parse error
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Overloaded method.

Parameters:
uri - a SAX imposed parameter representing a URI to the XML input file
localName - a namespace parameter
qName - the name of the current XML element
Throws:
org.xml.sax.SAXException - thrown if a parsing error occurs
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Overloaded method.

Parameters:
ch - an array of characters from the input XML file
start - the index of the first element of the 'ch' array that is meaningful for the current tag
length - the length of valid content in the 'ch' array from the starting index
Throws:
org.xml.sax.SAXException - thrown if a parsing error occurs
See Also:
ContentHandler.characters(char[], int, int)

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
This method is called by the SAX parser when the end of document is reached. It is at this point that we actually write the generated file.

Throws:
org.xml.sax.SAXException - thrown if a parsing error occurs
See Also:
ContentHandler.endDocument()

fatalError

public void fatalError(org.xml.sax.SAXParseException e)
                throws org.xml.sax.SAXException
Overloaded method.

Parameters:
e - an instance of a SAXParseException indicating a failure in parsing
Throws:
org.xml.sax.SAXException - thrown if a parsing error occurs
See Also:
ErrorHandler.fatalError(org.xml.sax.SAXParseException)