Package org.odftoolkit.odfdom.pkg
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 SAXErrorHandlerinterface. Enabled by System propertySystem.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
Constructors Constructor Description DefaultErrorHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiderror(SAXParseException exception)Triggers an error.voidfatalError(SAXParseException exception)Triggers a fatalError.List<SAXParseException>getErrors()List<SAXParseException>getFatalErrors()StringgetValidationMessages()List<SAXParseException>getWarnings()voidwarning(SAXParseException exception)Triggers an warning.
-
-
-
Method Detail
-
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:
warningin interfaceErrorHandler- 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:
errorin interfaceErrorHandler- 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:
fatalErrorin interfaceErrorHandler- 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()
-
-