org.apache.tools.ant.helper

Class ProjectHelper2.RootHandler

Enclosing Class:
ProjectHelper2

public static class ProjectHelper2.RootHandler
extends 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(AntXMLContext context, ProjectHelper2.AntHandler 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(String uri, String name, String qName)
Handles the end of an element.
void
endPrefixMapping(String prefix)
End a namepace prefix to uri mapping
ProjectHelper2.AntHandler
getCurrentAntHandler()
Returns the current ant handler object.
InputSource
resolveEntity(String publicId, String systemId)
Resolves file: URIs relative to the build file.
void
setDocumentLocator(Locator locator)
Sets the locator in the project helper for future reference.
void
startElement(String uri, String tag, String qname, Attributes attrs)
Handles the start of a project element.
void
startPrefixMapping(String prefix, String uri)
Start a namespace prefix to uri mapping

Constructor Details

RootHandler

public RootHandler(AntXMLContext context,
                   ProjectHelper2.AntHandler rootHandler)
Creates a new RootHandler instance.
Parameters:
context - The context for the handler.
rootHandler - The handler for the root element.

Method Details

characters

public void characters(char[] buf,
                       int start,
                       int count)
            throws 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.

endElement

public void endElement(String uri,
                       String name,
                       String qName)
            throws 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.

endPrefixMapping

public void endPrefixMapping(String prefix)
End a namepace prefix to uri mapping
Parameters:
prefix - the prefix that is not mapped anymore

getCurrentAntHandler

public ProjectHelper2.AntHandler getCurrentAntHandler()
Returns the current ant handler object.
Returns:
the current ant handler.

resolveEntity

public InputSource resolveEntity(String publicId,
                                 String systemId)
Resolves file: URIs relative to the build file.
Parameters:
publicId - The public identifier, or null if none is available. Ignored in this implementation.
systemId - The system identifier provided in the XML document. Will not be null.
Returns:
an inputsource for this identifier

setDocumentLocator

public void setDocumentLocator(Locator locator)
Sets the locator in the project helper for future reference.
Parameters:
locator - The locator used by the parser. Will not be null.

startElement

public void startElement(String uri,
                         String tag,
                         String qname,
                         Attributes attrs)
            throws 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.

startPrefixMapping

public void startPrefixMapping(String prefix,
                               String uri)
Start a namespace prefix to uri mapping
Parameters:
prefix - the namespace prefix
uri - the namespace uri

Copyright © 2000-2006 Apache Software Foundation. All Rights Reserved.