antsnest.io
Class AntNodeParser

java.lang.Object
  extended by antsnest.io.AntNodeParser
All Implemented Interfaces:
XMLReader

public class AntNodeParser
extends Object
implements XMLReader

Parser used to generate SAX events from an Ant's Nest node

Author:
Chris Clohosy

Constructor Summary
AntNodeParser(AntNode antNode)
          Constructs the parser
 
Method Summary
 ContentHandler getContentHandler()
          Gets the content handler
 DTDHandler getDTDHandler()
          Return the current DTD handler.
 EntityResolver getEntityResolver()
          Return the current entity resolver.
 ErrorHandler getErrorHandler()
          Returns null as an error handler
 boolean getFeature(String name)
          Look up the value of a feature.
 Object getProperty(String name)
          Gets only the lexical handler
 void parse(InputSource nullSource)
          Parses the node
 void parse(String systemId)
          Parse an XML document from a system identifier (URI).
 void setContentHandler(ContentHandler handler)
          Sets a content handler
 void setDTDHandler(DTDHandler handler)
          Allow an application to register a DTD event handler.
 void setEntityResolver(EntityResolver resolver)
          Allow an application to register an entity resolver.
 void setErrorHandler(ErrorHandler errorHandler)
          Takes an error handler but never sets it
 void setFeature(String name, boolean value)
          Set the state of a feature.
 void setProperty(String name, Object value)
          Used to get the lexical handler needed to record comments in the project
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AntNodeParser

public AntNodeParser(AntNode antNode)
Constructs the parser

Parameters:
antNode - the node to parse
Method Detail

parse

public void parse(InputSource nullSource)
           throws SAXException
Parses the node

Specified by:
parse in interface XMLReader
Parameters:
nullSource - an InputSource that is empty because its only use is to call this method
Throws:
SAXException - if there's a problem parsing the node

setContentHandler

public void setContentHandler(ContentHandler handler)
Sets a content handler

Specified by:
setContentHandler in interface XMLReader
Parameters:
handler - the content handler

getContentHandler

public ContentHandler getContentHandler()
Gets the content handler

Specified by:
getContentHandler in interface XMLReader
Returns:
a ContentHandler the content handler

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)
Takes an error handler but never sets it

Specified by:
setErrorHandler in interface XMLReader
Parameters:
errorHandler - the error handler

getErrorHandler

public ErrorHandler getErrorHandler()
Returns null as an error handler

Specified by:
getErrorHandler in interface XMLReader
Returns:
an ErrorHandler, in this case null

parse

public void parse(String systemId)
           throws IOException,
                  SAXException
Parse an XML document from a system identifier (URI).

Specified by:
parse in interface XMLReader
Throws:
IOException
SAXException

getDTDHandler

public DTDHandler getDTDHandler()
Return the current DTD handler.

Specified by:
getDTDHandler in interface XMLReader

getEntityResolver

public EntityResolver getEntityResolver()
Return the current entity resolver.

Specified by:
getEntityResolver in interface XMLReader

setEntityResolver

public void setEntityResolver(EntityResolver resolver)
Allow an application to register an entity resolver.

Specified by:
setEntityResolver in interface XMLReader

setDTDHandler

public void setDTDHandler(DTDHandler handler)
Allow an application to register a DTD event handler.

Specified by:
setDTDHandler in interface XMLReader

getProperty

public Object getProperty(String name)
Gets only the lexical handler

Specified by:
getProperty in interface XMLReader
Parameters:
name - only gets the lexical handler
Returns:
an Object, the lexical handler

setProperty

public void setProperty(String name,
                        Object value)
Used to get the lexical handler needed to record comments in the project

Specified by:
setProperty in interface XMLReader
Parameters:
name - the name of the property
value - the lexical handler in this case

setFeature

public void setFeature(String name,
                       boolean value)
Set the state of a feature.

Specified by:
setFeature in interface XMLReader

getFeature

public boolean getFeature(String name)
Look up the value of a feature.

Specified by:
getFeature in interface XMLReader