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.


Field Summary
static int ERROR
           
static int FATAL_ERROR
           
static int WARNING
           
 
Constructor Summary
DefaultErrorHandler()
           
DefaultErrorHandler(int errorLevel)
           
 
Method Summary
 void error(EventContextException ex)
           
 void error(org.xml.sax.SAXParseException ex)
           
 void fatalError(EventContextException ex)
           
 void fatalError(org.xml.sax.SAXParseException ex)
           
 int getErrorLevel()
           
 void setErrorLevel(int errorLevel)
          Sets the threshold for throwing exceptions rather than simply printing them.
 void warning(EventContextException ex)
           
 void warning(org.xml.sax.SAXParseException ex)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WARNING

public static int WARNING

ERROR

public static int ERROR

FATAL_ERROR

public static int FATAL_ERROR
Constructor Detail

DefaultErrorHandler

public DefaultErrorHandler()

DefaultErrorHandler

public DefaultErrorHandler(int errorLevel)
Method Detail

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