Class StandardErrorHandler

  • All Implemented Interfaces:
    org.xml.sax.ErrorHandler

    public class StandardErrorHandler
    extends java.lang.Object
    implements org.xml.sax.ErrorHandler
    A default implementation of the SAX ErrorHandler interface. Used by Saxon to catch XML parsing errors if no error handler is supplied by the application.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void error​(org.xml.sax.SAXParseException e)
      Callback interface for SAX: not for application use
      void fatalError​(org.xml.sax.SAXParseException e)
      Callback interface for SAX: not for application use
      int getErrorCount()
      Return the number of errors reported
      int getFatalErrorCount()
      Return the number of fatal errors reported
      int getWarningCount()
      Return the number of warnings (including warnings) reported
      protected void reportError​(org.xml.sax.SAXParseException e, boolean isFatal)
      Common routine for SAX errors and fatal errors
      void setSilent​(boolean silent)
      Indicate whether the error handler should report errors to the ErrorListener
      void warning​(org.xml.sax.SAXParseException e)
      Callback interface for SAX: not for application use
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • StandardErrorHandler

        public StandardErrorHandler​(ErrorReporter reporter)
    • Method Detail

      • setSilent

        public void setSilent​(boolean silent)
        Indicate whether the error handler should report errors to the ErrorListener
        Parameters:
        silent - if true, errors should not be reported. Used during doc-available() processing
      • warning

        public void warning​(org.xml.sax.SAXParseException e)
        Callback interface for SAX: not for application use
        Specified by:
        warning in interface org.xml.sax.ErrorHandler
      • error

        public void error​(org.xml.sax.SAXParseException e)
                   throws org.xml.sax.SAXException
        Callback interface for SAX: not for application use
        Specified by:
        error in interface org.xml.sax.ErrorHandler
        Throws:
        org.xml.sax.SAXException
      • fatalError

        public void fatalError​(org.xml.sax.SAXParseException e)
                        throws org.xml.sax.SAXException
        Callback interface for SAX: not for application use
        Specified by:
        fatalError in interface org.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 handled
        isFatal - 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