Class SaxParser.ValidationHandler

  • All Implemented Interfaces:
    ErrorHandler
    Enclosing class:
    SaxParser

    protected class SaxParser.ValidationHandler
    extends Object
    implements ErrorHandler
    An inner class Error Handler that is registered in parser that performs validation. It gets called when on warning, error, or fatalError.
    • Constructor Detail

      • ValidationHandler

        protected ValidationHandler()
    • Method Detail

      • error

        public void error​(SAXParseException e)
                   throws SAXException
        Routine called when a error occurs in parser. Logs the error message, saves the first exception and increments an errorCounter. Error count and exception can be retrieved when parsing is complete.
        Specified by:
        error in interface ErrorHandler
        Parameters:
        e - SAXParseException is error exception.
        Throws:
        SAXException
      • fatalError

        public void fatalError​(SAXParseException e)
                        throws SAXException
        Routine called when a fatal error occurs in parser. Logs the fatal error message and throws the exception.
        Specified by:
        fatalError in interface ErrorHandler
        Parameters:
        e - SAXParseException is fatal error exception.
        Throws:
        SAXException - if SAX error occurs
      • getErrorCount

        public int getErrorCount()
        Returns the number of Errors encountered.
        Returns:
        int error count
      • getException

        public SAXParseException getException()
        Returns a saved parser exception.
        Returns:
        SAXParseException Parser exception
      • isError

        public boolean isError()
        Returns boolean indicating if an error has occurred.
        Returns:
        boolean true if error else false