antsnest.io
Class BuildFileHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by org.xml.sax.ext.DefaultHandler2
          extended by antsnest.io.BuildFileHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler, DeclHandler, EntityResolver2, LexicalHandler

public class BuildFileHandler
extends DefaultHandler2

SAX handler for processing an Ant build file

Author:
Chris Clohosy

Constructor Summary
BuildFileHandler(AntInfo antInfo, IDPool idPool)
          Constructs a new handler
 
Method Summary
 void characters(char[] ch, int start, int length)
          Notifies that character data has been encountered
 void comment(char[] ch, int start, int length)
          Notifies that a comment has been encountered
 void endCDATA()
          Notifies that we have left a CDATA section
 void endElement(String uri, String localName, String qName)
          Notifies that the end of the element has been reached
 AntNode getAntNode()
          Gets the node created by this handler
 void startCDATA()
          Notifies that we have entered a CDATA section
 void startDocument()
          Notifies that the parsing has begun
 void startElement(String uri, String localName, String qName, Attributes attributes)
          Notifies that an element has been encountered
 
Methods inherited from class org.xml.sax.ext.DefaultHandler2
attributeDecl, elementDecl, endDTD, endEntity, externalEntityDecl, getExternalSubset, internalEntityDecl, resolveEntity, resolveEntity, startDTD, startEntity
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BuildFileHandler

public BuildFileHandler(AntInfo antInfo,
                        IDPool idPool)
Constructs a new handler

Parameters:
antInfo - the Ant information object
idPool - the ID pool used to generate IDs
Method Detail

getAntNode

public AntNode getAntNode()
Gets the node created by this handler

Returns:
an AntNode, the node

startDocument

public void startDocument()
Notifies that the parsing has begun

Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class DefaultHandler

startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
Notifies that an element has been encountered

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Parameters:
uri - the namespace URI
localName - the local name of the element
qName - the qualified name of the element
attributes - the attributes of the element

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
Notifies that the end of the element has been reached

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Parameters:
uri - the namespace URI
localName - the local name of the element
qName - the qualified name of the element

characters

public void characters(char[] ch,
                       int start,
                       int length)
Notifies that character data has been encountered

Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler
Parameters:
ch - the characters encountered
start - the start position in the character array
length - the number of characters to use from the array

comment

public void comment(char[] ch,
                    int start,
                    int length)
Notifies that a comment has been encountered

Specified by:
comment in interface LexicalHandler
Overrides:
comment in class DefaultHandler2
Parameters:
ch - the characters encountered
start - the start position in the character array
length - the number of characters to use from the array

startCDATA

public void startCDATA()
Notifies that we have entered a CDATA section

Specified by:
startCDATA in interface LexicalHandler
Overrides:
startCDATA in class DefaultHandler2

endCDATA

public void endCDATA()
Notifies that we have left a CDATA section

Specified by:
endCDATA in interface LexicalHandler
Overrides:
endCDATA in class DefaultHandler2