Package org.odftoolkit.odfdom.pkg
Class DefaultErrorHandler
java.lang.Object
org.odftoolkit.odfdom.pkg.DefaultErrorHandler
- All Implemented Interfaces:
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
error
(SAXParseException exception) Triggers an error.void
fatalError
(SAXParseException exception) Triggers a fatalError.void
warning
(SAXParseException exception) Triggers an warning.
-
Constructor Details
-
DefaultErrorHandler
public DefaultErrorHandler()
-
-
Method Details
-
warning
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 interfaceErrorHandler
- Throws:
SAXException
-
error
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 interfaceErrorHandler
- Throws:
SAXException
-
fatalError
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 interfaceErrorHandler
- Throws:
SAXException
-
getWarnings
- Returns:
- all warning SaxParseExceptions, all ODF recommendations not being fulfilled. Might be NULL.
-
getErrors
- Returns:
- all error SaxParseExceptions, all mandatory ODF requirements not being fulfilled. Might be NULL.
-
getFatalErrors
- Returns:
- all fatal-error SaxParseExceptions, ODF errors, which interrupt the program flow, e.g. loading a PDF as ODF. Might be NULL.
-
getValidationMessages
-