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

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

[This version spent some time in the package xml.newsax, while an older version was here in pagckage xml. This version differs from the older one most prominently in that it does not throw any exception in the case of a SAX error.]


Constructor Summary
BasicSAXHandler()
          Constructs a new handler with no entity resolver.
BasicSAXHandler(CleanerEntityResolver er)
          Constructs a new handler with the given entity resolver.
 
Method Summary
 void error(org.xml.sax.SAXParseException spx)
          SAX Error handler: just reports the given exception on standard output.
 void fatalError(org.xml.sax.SAXParseException spx)
          SAX Fatal Error handler: just re-throws the given exception.
 org.xml.sax.InputSource resolveEntity(java.lang.String publicId, java.lang.String systemId)
          Peforms entity resolution on the given public and system Ids, using this handler's resolver if it has one.
 void setDocumentLocator(org.xml.sax.Locator lctr)
          Sets this handler's XML locator to be the given one.
 void warning(org.xml.sax.SAXParseException spx)
          SAX Warning handler: just reports the given exception on standard output.
 
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()
Constructs a new handler with no entity resolver.


BasicSAXHandler

public BasicSAXHandler(CleanerEntityResolver er)
Constructs a new handler with the given entity resolver.

Method Detail

resolveEntity

public org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
                                             java.lang.String systemId)
                                      throws org.xml.sax.SAXException
Peforms entity resolution on the given public and system Ids, using this handler's resolver if it has one.

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 XML locator to be the given one.

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
SAX Warning handler: just reports the given exception on standard output.

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
SAX Error handler: just reports the given exception on standard output.

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
SAX Fatal Error handler: just re-throws the given exception.

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