ErrorHandler

Basic interface for SAX error handlers.

<p>If a SAX application needs to implement customized error handling, it must implement this interface and then register an instance with the XML reader using the {@link org.xml.sax.XMLReader#setErrorHandler setErrorHandler} method. The parser will then report all errors and warnings through this interface.</p>

<p><strong>WARNING:</strong> If an application does <em>not</em> register an ErrorHandler, XML parsing errors will go unreported, except that <em>SAXParseException</em>s will be thrown for fatal errors. In order to detect validity errors, an ErrorHandler that does something with {@link #error error()} calls must be registered.</p>

<p>For XML processing errors, a SAX driver must use this interface in preference to throwing an exception: it is up to the application to decide whether to throw an exception for different types of errors and warnings. Note, however, that there is no requirement that the parser continue to report additional errors after a call to {@link #fatalError fatalError}. In other words, a SAX driver class may throw an exception after reporting any fatalError. Also parsers may throw appropriate exceptions for non-XML errors. For example, {@link XMLReader#parse XMLReader.parse()} would throw an IOException for errors accessing entities or the document.</p>

@since SAX 1.0 @author David Megginson @version 2.0.1+ (sax2r3pre1) @see org.xml.sax.XMLReader#setErrorHandler @see org.xml.sax.SAXParseException

Members

Functions

error
void error(SAXException exception)

Receive notification of a recoverable error.

fatalError
void fatalError(SAXException exception)

Receive notification of a non-recoverable error.

warning
void warning(SAXException exception)

Receive notification of a warning.

Meta