org.oddjob.ant
Class AntElementHandler

java.lang.Object
  extended byorg.oddjob.arooa.ArooaHandler
      extended byorg.oddjob.ant.AntElementHandler

public class AntElementHandler
extends ArooaHandler

Handler for a nested element.


Constructor Summary
AntElementHandler(org.apache.tools.ant.Project project)
          Constructor.
 
Method Summary
 void characters(char[] buf, int start, int count, ArooaContext context)
          Adds text to the task, using the wrapper
 ArooaHandler onStartChild(java.lang.String uri, java.lang.String tag, java.lang.String qname, org.xml.sax.Attributes attrs, ArooaContext context)
          Handles the start of an element within a target.
 void onStartElement(java.lang.String uri, java.lang.String tag, java.lang.String qname, org.xml.sax.Attributes attrs, ArooaContext context)
          Initialisation routine called after handler creation with the element name and attributes.
 
Methods inherited from class org.oddjob.arooa.ArooaHandler
checkNamespace, onEndChild, onEndElement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AntElementHandler

public AntElementHandler(org.apache.tools.ant.Project project)
Constructor.

Method Detail

onStartElement

public void onStartElement(java.lang.String uri,
                           java.lang.String tag,
                           java.lang.String qname,
                           org.xml.sax.Attributes attrs,
                           ArooaContext context)
                    throws org.xml.sax.SAXParseException
Initialisation routine called after handler creation with the element name and attributes. This configures the element with its attributes and sets it up with its parent container (if any). Nested elements are then added later as the parser encounters them.

Overrides:
onStartElement in class ArooaHandler
Parameters:
uri - The namespace URI for this element.
tag - Name of the element which caused this handler to be created. Must not be null.
qname - The qualified name for this element.
attrs - Attributes of the element which caused this handler to be created. Must not be null.
context - The current context.
Throws:
org.xml.sax.SAXParseException - in case of error (not thrown in this implementation)

characters

public void characters(char[] buf,
                       int start,
                       int count,
                       ArooaContext context)
                throws org.xml.sax.SAXParseException
Adds text to the task, using the wrapper

Overrides:
characters in class ArooaHandler
Parameters:
buf - A character array of the text within the element. Will not be null.
start - The start element in the array.
count - The number of characters to read from the array.
context - The current context.
Throws:
org.xml.sax.SAXParseException - if the element doesn't support text

onStartChild

public ArooaHandler onStartChild(java.lang.String uri,
                                 java.lang.String tag,
                                 java.lang.String qname,
                                 org.xml.sax.Attributes attrs,
                                 ArooaContext context)
Handles the start of an element within a target. Task containers will always use another task handler, and all other tasks will always use a nested element handler.

Overrides:
onStartChild in class ArooaHandler
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.
context - The current context.
Returns:
The handler for elements.
Throws:
org.xml.sax.SAXParseException - if an error occurs when initialising the appropriate child handler