Class DefaultErrorHandler
java.lang.Object
com.aquima.interactions.foundation.xml.parsing.DefaultErrorHandler
- All Implemented Interfaces:
ErrorHandler
Default SAX2 / DOM ErrorHandler class. Stores errors in a string List.
This ErrorHandler is used by default in both (SAX & DOM) parsers. They have a method to extract the error Iterator from this handler. When the parser failed, you get the error Iterator from the parser and process all error messages in this Iterator.
It is not possible to supply your own error handler, that's why this class is not public. You have to do post-mortem error processing as discussed above.
- Since:
- 5.0
- Author:
- IdJ
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
allOk()
test if the parsing went ok.void
clear()
Clears the errors.void
SAX2 Error handler - called while parsing.void
SAX2 Fatal error handler - called while parsing.String[]
gets the list of parse errors.void
SAX2 Warning handler - called while parsing.
-
Constructor Details
-
Method Details
-
allOk
public boolean allOk()test if the parsing went ok.- Returns:
- boolean indicating if the parsing went ok.
-
getErrors
gets the list of parse errors.- Returns:
- array of errors, may be empty, but never null.
-
clear
public void clear()Clears the errors. -
warning
SAX2 Warning handler - called while parsing.- Specified by:
warning
in interfaceErrorHandler
- Parameters:
ex
- The exception that occurred while parsing.
-
error
SAX2 Error handler - called while parsing.- Specified by:
error
in interfaceErrorHandler
- Parameters:
ex
- The exception that occurred while parsing.
-
fatalError
SAX2 Fatal error handler - called while parsing.- Specified by:
fatalError
in interfaceErrorHandler
- Parameters:
ex
- The exception that occurred while parsing.
-