org.apache.tools.ant.helper
Class ProjectHelper2.AntHandler
java.lang.Object
org.apache.tools.ant.helper.ProjectHelper2.AntHandler
- ProjectHelper2
public static class ProjectHelper2.AntHandler
extends java.lang.Object
The common superclass for all SAX event handlers used to parse
the configuration file.
The context will hold all state information. At each time
there is one active handler for the current element. It can
use onStartChild() to set an alternate handler for the child.
void | characters(char[] buf, int start, int count, AntXMLContext context) - Handles text within an element.
|
protected void | checkNamespace(String uri) - Will be called every time a namespace is reached.
|
void | onEndChild(String uri, String tag, String qname, AntXMLContext context) - Handle the end of a element.
|
void | onEndElement(String uri, String tag, AntXMLContext context) - This method is called when this element and all elements nested into it have been
handled.
|
ProjectHelper2.AntHandler | onStartChild(String uri, String tag, String qname, Attributes attrs, AntXMLContext context) - Handles the start of an element.
|
void | onStartElement(String uri, String tag, String qname, Attributes attrs, AntXMLContext context) - Handles the start of an element.
|
characters
public void characters(char[] buf,
int start,
int count,
AntXMLContext context)
throws SAXParseException
Handles text within an element. This base implementation just
throws an exception, you must override it if you expect content.
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.
checkNamespace
protected void checkNamespace(String uri)
Will be called every time a namespace is reached.
It'll verify if the ns was processed, and if not load the task
definitions.
onEndChild
public void onEndChild(String uri,
String tag,
String qname,
AntXMLContext context)
throws SAXParseException
Handle the end of a element.
uri
- the namespace uri of the elementtag
- the tag of the elementqname
- the qualified name of the elementcontext
- the current context
onEndElement
public void onEndElement(String uri,
String tag,
AntXMLContext context)
This method is called when this element and all elements nested into it have been
handled. I.e., this happens at the </end_tag_of_the_element>.
uri
- the namespace uri for this elementtag
- the element namecontext
- the current context
onStartChild
public ProjectHelper2.AntHandler onStartChild(String uri,
String tag,
String qname,
Attributes attrs,
AntXMLContext context)
throws SAXParseException
Handles the start of an element. This base implementation just
throws an exception - you must override this method if you expect
child elements.
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.
- a handler (in the derived classes)
onStartElement
public void onStartElement(String uri,
String tag,
String qname,
Attributes attrs,
AntXMLContext context)
throws SAXParseException
Handles the start of an element. This base implementation does
nothing.
uri
- the namespace URI for the tagtag
- The name of the element being started.
Will not be null
.qname
- The qualified name of the element.attrs
- Attributes of the element being started.
Will not be null
.context
- The context that this element is in.
Copyright B) 2000-2008 Apache Software Foundation. All Rights Reserved.