Class DefaultErrorHandler

  • All Implemented Interfaces:
    ErrorHandler

    public class DefaultErrorHandler
    extends Object
    implements ErrorHandler
    Warnings and errors of the ODF input document are being registered here without breaking the load process. In general the end user would like to load the full document to access its information. Default implementation of the SAX ErrorHandler interface. Enabled by System property System.setProperty("org.odftoolkit.odfdom.validation", "true"); Unfulfilled recommendations from the specification (e.g. ODF specifications) are warnings. Unfulfilled mandatory requirements from the specifications are warnings. Those errors, which interrupt the program flow, e.g. loading a graphic instead of XML is a fatal error.
    • Constructor Detail

      • DefaultErrorHandler

        public DefaultErrorHandler()
    • Method Detail

      • fatalError

        public void fatalError​(SAXParseException exception)
                        throws SAXException
        Triggers a fatalError. The ODF document can not be loaded due to an error. * Default handling is to write into Java log using severe level and to throw a SAXException
        Specified by:
        fatalError in interface ErrorHandler
        Throws:
        SAXException
      • getWarnings

        public List<SAXParseException> getWarnings()
        Returns:
        all warning SaxParseExceptions, all ODF recommendations not being fulfilled. Might be NULL.
      • getErrors

        public List<SAXParseException> getErrors()
        Returns:
        all error SaxParseExceptions, all mandatory ODF requirements not being fulfilled. Might be NULL.
      • getFatalErrors

        public List<SAXParseException> getFatalErrors()
        Returns:
        all fatal-error SaxParseExceptions, ODF errors, which interrupt the program flow, e.g. loading a PDF as ODF. Might be NULL.
      • getValidationMessages

        public String getValidationMessages()