org.xml.sax
Interface ErrorHandler


public interface ErrorHandler

Basic interface for SAX error handlers.

This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY.

This is ARP specific documentation, for the general SAX documentation try the Xerces copy.

If an ARP application needs to implement customized error handling, it must implement this interface and then register an instance with the XML reader using the setErrorHandler method. Both the XML and RDF parsers will then report all errors and warnings through this interface.

Within ARP, the default error handler reports all errors to System.err.

RDF related errors are instances of ParseException. Within ARP these are handled specially in their relationship to ErrorHandlers, in that immediately throwing the ParseException passed into the ErrorHandler method is used to indicate a promotion of the exception: from a warning to an error ; from an error to a fatalError; or from a fatalError to an Exception thrown from ARP.load.

Since:
SAX 1.0
See Also:
SAXParseException

Method Summary
 void error(SAXParseException exception)
          Receive notification of a recoverable error.
 void fatalError(SAXParseException exception)
          Receive notification of a non-recoverable error.
 void warning(SAXParseException exception)
          Receive notification of a warning.
 

Method Detail

warning

public void warning(SAXParseException exception)
             throws SAXException
Receive notification of a warning.

When exception is an instance of ParseException, then it is RDF related; otherwise it is an XML related exception thrown from Xerces.

When it is an RDF related ParseException, it is for a condition whose current error mode is EM_WARNING.

In this case, if the handler throws exception then it will be treated as an EM_ERROR and error will be called. If any other exception is thrown then that will be thrown from ARP.load back into user code.

Parameters:
exception - The warning information encapsulated in a SAX parse exception.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.

error

public void error(SAXParseException exception)
           throws SAXException
Receive notification of a recoverable error.

When exception is an instance of ParseException, then it is RDF related; otherwise it is an XML related exception thrown from Xerces.

When it is an RDF related ParseException, it is for a condition whose current error mode is EM_ERROR.

In this case, if the handler throws exception then it will be treated as an EM_FATAL and fatalError will be called. If any other exception is thrown then that will be thrown from ARP.load back into user code.

Parameters:
exception - The error information encapsulated in a SAX parse exception.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.

fatalError

public void fatalError(SAXParseException exception)
                throws SAXException
Receive notification of a non-recoverable error. *

When exception is an instance of ParseException, then it is RDF related; otherwise it is an XML related exception thrown from Xerces.

When it is an RDF related ParseException, it is for a condition whose current error mode is EM_FATAL.

In this case, if the handler throws exception or any other exception is thrown then that will be thrown from ARP.load back into user code.

Parameters:
exception - The error information encapsulated in a SAX parse exception.
Throws:
SAXException - Any SAX exception, possibly wrapping another exception.