Class CountingErrorHandler
- All Implemented Interfaces:
ErrorHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Receive notification of a recoverable parser error.void
Report a fatal XML parsing error.int
int
void
void
Receive notification of a parser warning.
-
Constructor Details
-
CountingErrorHandler
public CountingErrorHandler()
-
-
Method Details
-
warning
Receive notification of a parser warning.The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each warning, such as inserting the message in a log file or printing it to the console.
- Specified by:
warning
in interfaceErrorHandler
- Parameters:
e
- The warning information encoded as an exception.- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.- See Also:
-
error
Receive notification of a recoverable parser error.The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each error, such as inserting the message in a log file or printing it to the console.
- Specified by:
error
in interfaceErrorHandler
- Parameters:
e
- The warning information encoded as an exception.- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.- See Also:
-
fatalError
Report a fatal XML parsing error.The default implementation throws a SAXParseException. Application writers may override this method in a subclass if they need to take specific actions for each fatal error (such as collecting all of the errors into a single report): in any case, the application must stop all regular processing when this method is invoked, since the document is no longer reliable, and the parser may no longer report parsing events.
- Specified by:
fatalError
in interfaceErrorHandler
- Parameters:
e
- The error information encoded as an exception.- Throws:
SAXException
- Any SAX exception, possibly wrapping another exception.- See Also:
-
getErrorCount
public int getErrorCount() -
getWarningCount
public int getWarningCount() -
printSummary
public void printSummary()
-