Class DefaultErrorHandler
- java.lang.Object
-
- com.aquima.interactions.foundation.xml.parsing.DefaultErrorHandler
-
- All Implemented Interfaces:
ErrorHandler
public class DefaultErrorHandler extends Object implements 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 Constructor Description DefaultErrorHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
allOk()
test if the parsing went ok.void
clear()
Clears the errors.void
error(SAXParseException ex)
SAX2 Error handler - called while parsing.void
fatalError(SAXParseException ex)
SAX2 Fatal error handler - called while parsing.String[]
getErrors()
gets the list of parse errors.void
warning(SAXParseException ex)
SAX2 Warning handler - called while parsing.
-
-
-
Method Detail
-
allOk
public boolean allOk()
test if the parsing went ok.- Returns:
- boolean indicating if the parsing went ok.
-
getErrors
public String[] 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
public void warning(SAXParseException ex)
SAX2 Warning handler - called while parsing.- Specified by:
warning
in interfaceErrorHandler
- Parameters:
ex
- The exception that occurred while parsing.
-
error
public void error(SAXParseException ex)
SAX2 Error handler - called while parsing.- Specified by:
error
in interfaceErrorHandler
- Parameters:
ex
- The exception that occurred while parsing.
-
fatalError
public void fatalError(SAXParseException ex)
SAX2 Fatal error handler - called while parsing.- Specified by:
fatalError
in interfaceErrorHandler
- Parameters:
ex
- The exception that occurred while parsing.
-
-