Package org.apache.tools.ant.helper
Class ProjectHelper2.RootHandler
- java.lang.Object
- 
- org.xml.sax.helpers.DefaultHandler
- 
- org.apache.tools.ant.helper.ProjectHelper2.RootHandler
 
 
- 
- All Implemented Interfaces:
- org.xml.sax.ContentHandler,- org.xml.sax.DTDHandler,- org.xml.sax.EntityResolver,- org.xml.sax.ErrorHandler
 - Enclosing class:
- ProjectHelper2
 
 public static class ProjectHelper2.RootHandler extends org.xml.sax.helpers.DefaultHandlerHandler 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 SummaryConstructors Constructor Description RootHandler(AntXMLContext context, ProjectHelper2.AntHandler rootHandler)Creates a new RootHandler instance.
 - 
Method SummaryModifier and Type Method Description voidcharacters(char[] buf, int start, int count)Handle text within an element, calls currentHandler.characters.voidendElement(java.lang.String uri, java.lang.String name, java.lang.String qName)Handles the end of an element.voidendPrefixMapping(java.lang.String prefix)End a namespace prefix to uri mappingProjectHelper2.AntHandlergetCurrentAntHandler()Returns the current ant handler object.org.xml.sax.InputSourceresolveEntity(java.lang.String publicId, java.lang.String systemId)Resolves file: URIs relative to the build file.voidsetDocumentLocator(org.xml.sax.Locator locator)Sets the locator in the project helper for future reference.voidstartElement(java.lang.String uri, java.lang.String tag, java.lang.String qname, org.xml.sax.Attributes attrs)Handles the start of a project element.voidstartPrefixMapping(java.lang.String prefix, java.lang.String uri)Start a namespace prefix to uri mapping
 
- 
- 
- 
Constructor Detail- 
RootHandlerpublic 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 Detail- 
getCurrentAntHandlerpublic ProjectHelper2.AntHandler getCurrentAntHandler() Returns the current ant handler object.- Returns:
- the current ant handler.
 
 - 
resolveEntitypublic org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)Resolves file: URIs relative to the build file.- Specified by:
- resolveEntityin interface- org.xml.sax.EntityResolver
- Overrides:
- resolveEntityin class- org.xml.sax.helpers.DefaultHandler
- Parameters:
- publicId- The public identifier, or- nullif 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
 
 - 
startElementpublic void startElement(java.lang.String uri, java.lang.String tag, java.lang.String qname, org.xml.sax.Attributes attrs) throws org.xml.sax.SAXParseExceptionHandles the start of a project element. A project handler is created and initialised with the element name and attributes.- Specified by:
- startElementin interface- org.xml.sax.ContentHandler
- Overrides:
- startElementin class- org.xml.sax.helpers.DefaultHandler
- 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"
 
 - 
setDocumentLocatorpublic void setDocumentLocator(org.xml.sax.Locator locator) Sets the locator in the project helper for future reference.- Specified by:
- setDocumentLocatorin interface- org.xml.sax.ContentHandler
- Overrides:
- setDocumentLocatorin class- org.xml.sax.helpers.DefaultHandler
- Parameters:
- locator- The locator used by the parser. Will not be- null.
 
 - 
endElementpublic void endElement(java.lang.String uri, java.lang.String name, java.lang.String qName) throws org.xml.sax.SAXExceptionHandles 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.- Specified by:
- endElementin interface- org.xml.sax.ContentHandler
- Overrides:
- endElementin class- org.xml.sax.helpers.DefaultHandler
- 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)
 
 - 
characterspublic void characters(char[] buf, int start, int count) throws org.xml.sax.SAXParseExceptionHandle text within an element, calls currentHandler.characters.- Specified by:
- charactersin interface- org.xml.sax.ContentHandler
- Overrides:
- charactersin class- org.xml.sax.helpers.DefaultHandler
- 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
 
 - 
startPrefixMappingpublic void startPrefixMapping(java.lang.String prefix, java.lang.String uri)Start a namespace prefix to uri mapping- Specified by:
- startPrefixMappingin interface- org.xml.sax.ContentHandler
- Overrides:
- startPrefixMappingin class- org.xml.sax.helpers.DefaultHandler
- Parameters:
- prefix- the namespace prefix
- uri- the namespace uri
 
 - 
endPrefixMappingpublic void endPrefixMapping(java.lang.String prefix) End a namespace prefix to uri mapping- Specified by:
- endPrefixMappingin interface- org.xml.sax.ContentHandler
- Overrides:
- endPrefixMappingin class- org.xml.sax.helpers.DefaultHandler
- Parameters:
- prefix- the prefix that is not mapped anymore
 
 
- 
 
-