Package net.sf.saxon.lib
Class StandardErrorHandler
- java.lang.Object
-
- net.sf.saxon.lib.StandardErrorHandler
-
- All Implemented Interfaces:
org.xml.sax.ErrorHandler
public class StandardErrorHandler extends java.lang.Object implements org.xml.sax.ErrorHandlerA default implementation of the SAX ErrorHandler interface. Used by Saxon to catch XML parsing errors if no error handler is supplied by the application.
-
-
Constructor Summary
Constructors Constructor Description StandardErrorHandler(javax.xml.transform.ErrorListener listener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiderror(org.xml.sax.SAXParseException e)Callback interface for SAX: not for application usevoidfatalError(org.xml.sax.SAXParseException e)Callback interface for SAX: not for application useintgetErrorCount()Return the number of errors reportedintgetFatalErrorCount()Return the number of fatal errors reportedintgetWarningCount()Return the number of warnings (including warnings) reportedprotected voidreportError(org.xml.sax.SAXParseException e, boolean isFatal)Common routine for SAX errors and fatal errorsvoidsetErrorOutput(java.io.Writer writer)Set output for error messages produced by the default error handler.voidwarning(org.xml.sax.SAXParseException e)Callback interface for SAX: not for application use
-
-
-
Method Detail
-
setErrorOutput
public void setErrorOutput(java.io.Writer writer)
Set output for error messages produced by the default error handler. The default error handler does not throw an exception for parse errors or input I/O errors, rather it returns a result code and writes diagnostics to a user-specified output writer, which defaults to System.err
This call has no effect if setErrorHandler() has been called to supply a user-defined error handler- Parameters:
writer- The Writer to use for error messages
-
warning
public void warning(org.xml.sax.SAXParseException e)
Callback interface for SAX: not for application use- Specified by:
warningin interfaceorg.xml.sax.ErrorHandler
-
error
public void error(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXExceptionCallback interface for SAX: not for application use- Specified by:
errorin interfaceorg.xml.sax.ErrorHandler- Throws:
org.xml.sax.SAXException
-
fatalError
public void fatalError(org.xml.sax.SAXParseException e) throws org.xml.sax.SAXExceptionCallback interface for SAX: not for application use- Specified by:
fatalErrorin interfaceorg.xml.sax.ErrorHandler- Throws:
org.xml.sax.SAXException
-
reportError
protected void reportError(org.xml.sax.SAXParseException e, boolean isFatal)Common routine for SAX errors and fatal errors- Parameters:
e- the exception being handledisFatal- true if the error is classified as fatal
-
getWarningCount
public int getWarningCount()
Return the number of warnings (including warnings) reported- Returns:
- the number of warnings
-
getErrorCount
public int getErrorCount()
Return the number of errors reported- Returns:
- the number of non-fatal errors
-
getFatalErrorCount
public int getFatalErrorCount()
Return the number of fatal errors reported- Returns:
- the number of fatal errors
-
-