xml
Class BasicSAXHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by xml.BasicSAXHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler
Direct Known Subclasses:
HNSSignSAXHandler, SiGMLStreamHandler, XMLStringSAXHandler

public class BasicSAXHandler
extends org.xml.sax.helpers.DefaultHandler

A base class for a SAX Handler. The only handling done here is house-keeping, i.e. entity resolution, locator setting, and basic error reporting. So to get any useful processing of XML content, a subclass of this one will be needed.


Constructor Summary
BasicSAXHandler(java.lang.String xmlkindtag, CleanerEntityResolver er)
          Constructs a new SAX handler, with the given input kind tag and entity resolver.
 
Method Summary
 void error(org.xml.sax.SAXParseException spx)
          Reports and re-throws the given SAX parsing error.
 void fatalError(org.xml.sax.SAXParseException spx)
          Reports and re-throws the given fatal SAX parsing exception.
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
          Attempts to resolve the entity defined by the given public and system IDs, returning the appropriate input source if successful or null if this handler has no entity resolver or if it does not recognize the given IDs.
 void setDocumentLocator(org.xml.sax.Locator lctr)
          Sets this handler's locator to be the one given.
 void warning(org.xml.sax.SAXParseException spx)
          Reports the given SAX parsing warning.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicSAXHandler

public BasicSAXHandler(java.lang.String xmlkindtag,
                       CleanerEntityResolver er)
Constructs a new SAX handler, with the given input kind tag and entity resolver.

Method Detail

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws org.xml.sax.SAXException
Attempts to resolve the entity defined by the given public and system IDs, returning the appropriate input source if successful or null if this handler has no entity resolver or if it does not recognize the given IDs.

Specified by:
resolveEntity in interface org.xml.sax.EntityResolver
Overrides:
resolveEntity in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator lctr)
Sets this handler's locator to be the one given.

Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler
Overrides:
setDocumentLocator in class org.xml.sax.helpers.DefaultHandler

warning

public void warning(org.xml.sax.SAXParseException spx)
             throws org.xml.sax.SAXException
Reports the given SAX parsing warning.

Specified by:
warning in interface org.xml.sax.ErrorHandler
Overrides:
warning in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

error

public void error(org.xml.sax.SAXParseException spx)
           throws org.xml.sax.SAXException
Reports and re-throws the given SAX parsing error.

Specified by:
error in interface org.xml.sax.ErrorHandler
Overrides:
error in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

fatalError

public void fatalError(org.xml.sax.SAXParseException spx)
                throws org.xml.sax.SAXException
Reports and re-throws the given fatal SAX parsing exception.

Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Overrides:
fatalError in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException