org.oddjob.arooa
Class RootHandler

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

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

Handler for ant processing. Uses a stack of AntHandlers to implement each element ( the original parser used a recursive behavior, with the implicit execution stack )


Constructor Summary
RootHandler(ArooaContext context, ArooaHandler rootHandler)
          Creates a new RootHandler instance.
 
Method Summary
 void characters(char[] buf, int start, int count)
          Handle text within an element, calls currentHandler.characters.
 void endElement(java.lang.String uri, java.lang.String name, java.lang.String qName)
          Handles the end of an element.
 void endPrefixMapping(java.lang.String prefix)
          End a namepace prefix to uri mapping
 void setDocumentLocator(org.xml.sax.Locator locator)
          Sets the locator in the project helper for future reference.
 void startElement(java.lang.String uri, java.lang.String tag, java.lang.String qname, org.xml.sax.Attributes attrs)
          Handles the start of a project element.
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          Start a namespace prefix to uri mapping
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RootHandler

public RootHandler(ArooaContext context,
                   ArooaHandler rootHandler)
Creates a new RootHandler instance.

Parameters:
context - The context for the handler.
rootHandler - The handler for the root element.
Method Detail

startElement

public void startElement(java.lang.String uri,
                         java.lang.String tag,
                         java.lang.String qname,
                         org.xml.sax.Attributes attrs)
                  throws org.xml.sax.SAXParseException
Handles the start of a project element. A project handler is created and initialised with the element name and attributes.

Parameters:
uri - The namespace uri for this element.
tag - The name of the element being started. Will not be null.
qname - The qualified name for this element.
attrs - Attributes of the element being started. Will not be null.
Throws:
org.xml.sax.SAXParseException - if the tag given is not "project"

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator locator)
Sets the locator in the project helper for future reference.

Parameters:
locator - The locator used by the parser. Will not be null.

endElement

public void endElement(java.lang.String uri,
                       java.lang.String name,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Handles the end of an element. Any required clean-up is performed by the onEndElement() method and then the original handler is restored to the parser.

Parameters:
uri - The namespace URI for this element.
name - The name of the element which is ending. Will not be null.
qName - The qualified name for this element.
Throws:
org.xml.sax.SAXException - in case of error (not thrown in this implementation)

characters

public void characters(char[] buf,
                       int start,
                       int count)
                throws org.xml.sax.SAXParseException
Handle text within an element, calls currentHandler.characters.

Parameters:
buf - A character array of the test.
start - The start offset in the array.
count - The number of characters to read.
Throws:
org.xml.sax.SAXParseException - if an error occurs

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
Start a namespace prefix to uri mapping

Parameters:
prefix - the namespace prefix
uri - the namespace uri

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
End a namepace prefix to uri mapping

Parameters:
prefix - the prefix that is not mapped anymore