Class DefaultErrorHandler

java.lang.Object
org.odftoolkit.odfdom.pkg.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 Details

    • DefaultErrorHandler

      public DefaultErrorHandler()
  • Method Details

    • warning

      public void warning(SAXParseException exception) throws SAXException
      Triggers an warning. In case an optional ODF conformance was not satisfied. Default handling is to write into Java log using warning level
      Specified by:
      warning in interface ErrorHandler
      Throws:
      SAXException
    • error

      public void error(SAXParseException exception) throws SAXException
      Triggers an error. In case a mandatory ODF conformance was not satisfied. Default handling is to write into Java log using severe level
      Specified by:
      error in interface ErrorHandler
      Throws:
      SAXException
    • 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()