net.sf.swan.xml.input.event
Class DefaultErrorHandler
java.lang.Object
|
+--net.sf.swan.xml.input.event.DefaultErrorHandler
- All Implemented Interfaces:
- ErrorHandler, org.xml.sax.ErrorHandler
- public class DefaultErrorHandler
- extends java.lang.Object
- implements org.xml.sax.ErrorHandler, ErrorHandler
Default ErrorHandler
implementation
that may also be used as a SAX ErrorHandler
.
This simply prints the stack trace of exceptions to System.err
.
For any notification that equals or exceeds the configured
error level
, the exception is thrown.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WARNING
public static int WARNING
ERROR
public static int ERROR
FATAL_ERROR
public static int FATAL_ERROR
DefaultErrorHandler
public DefaultErrorHandler()
DefaultErrorHandler
public DefaultErrorHandler(int errorLevel)
getErrorLevel
public int getErrorLevel()
setErrorLevel
public void setErrorLevel(int errorLevel)
- Sets the threshold for throwing exceptions rather than simply
printing them. The value should be one of
WARNING
, ERROR
, or FATAL_ERROR
.
warning
public void warning(org.xml.sax.SAXParseException ex)
throws org.xml.sax.SAXException
- Specified by:
warning
in interface org.xml.sax.ErrorHandler
error
public void error(org.xml.sax.SAXParseException ex)
throws org.xml.sax.SAXException
- Specified by:
error
in interface org.xml.sax.ErrorHandler
fatalError
public void fatalError(org.xml.sax.SAXParseException ex)
throws org.xml.sax.SAXException
- Specified by:
fatalError
in interface org.xml.sax.ErrorHandler
warning
public void warning(EventContextException ex)
throws EventContextException
- Specified by:
warning
in interface ErrorHandler
error
public void error(EventContextException ex)
throws EventContextException
- Specified by:
error
in interface ErrorHandler
fatalError
public void fatalError(EventContextException ex)
throws EventContextException
- Specified by:
fatalError
in interface ErrorHandler