public class ExceptionErrorHandler
extends java.lang.Object
implements org.xml.sax.ErrorHandler
ExceptionErrorHandler class implements an error handler
for XML SAX and DOM parsers. This error handler throws an exception of
type SAXException for all warnings, errors, and fatal errors.| Constructor and Description |
|---|
ExceptionErrorHandler()
The
ExceptionErrorHandler constructor does nothing. |
| Modifier and Type | Method and Description |
|---|---|
void |
error(org.xml.sax.SAXParseException ex)
Throw a
SAXException if the parser issues an error. |
void |
fatalError(org.xml.sax.SAXParseException ex)
Throw a
SAXException if the parser issues a fatal error. |
void |
warning(org.xml.sax.SAXParseException ex)
Throw a
SAXException if the parser issues a warning. |
public ExceptionErrorHandler()
ExceptionErrorHandler constructor does nothing.public void warning(org.xml.sax.SAXParseException ex)
throws org.xml.sax.SAXException
SAXException if the parser issues a warning.
SAX parsers issue a warning to report conditions that are not errors
or fatal errors by the XML 1.0 recommendation. By definition, the
parser could recover from a warning. The default parser action for
a warning is to take no action; by throwing an exception, we ensure
that all XML documents are up to our high standards of quality.warning in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXExceptionpublic void error(org.xml.sax.SAXParseException ex)
throws org.xml.sax.SAXException
SAXException if the parser issues an error.
SAX parsers issue an error to report conditions that are errors
by the W3C XML recommendation but are recoverable errors. The
default behavior for errors is to take no action; we throw an
exception since we want our XML documents to be well-formed and
valid.error in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXExceptionpublic void fatalError(org.xml.sax.SAXParseException ex)
throws org.xml.sax.SAXException
SAXException if the parser issues a fatal error.
SAX parsers issue a fatal error if it cannot continue parsing the XML
document. The default behavior for fatal errors is to throw an
exception of type SAXException.fatalError in interface org.xml.sax.ErrorHandlerorg.xml.sax.SAXException