ErrorHandler (Java Platform SE 7 ) (original) (raw)


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. See http://www.saxproject.org for further information.
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 thesetErrorHandler method. The parser will then report all errors and warnings through this interface.
WARNING: If an application does not register an ErrorHandler, XML parsing errors will go unreported, except that _SAXParseException_s will be thrown for fatal errors. In order to detect validity errors, an ErrorHandler that does something with error() calls must be registered.
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 tofatalError. 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, XMLReader.parse() would throw an IOException for errors accessing entities or the document.
Since:
SAX 1.0
See Also:
XMLReader.setErrorHandler(org.xml.sax.ErrorHandler), SAXParseException

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2020, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.