public class CountingErrorHandler extends Object implements ErrorHandler
| Modifier and Type | Field and Description |
|---|---|
private static Debug |
_debug |
private int |
_errorCount |
private int |
_numberOfWarnings |
| Constructor and Description |
|---|
CountingErrorHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
error(SAXParseException e)
Receive notification of a recoverable parser error.
|
void |
fatalError(SAXParseException e)
Report a fatal XML parsing error.
|
int |
getErrorCount() |
int |
getWarningCount() |
void |
printSummary() |
private static String |
toString(SAXParseException e) |
void |
warning(SAXParseException e)
Receive notification of a parser warning.
|
private static final Debug _debug
private int _errorCount
private int _numberOfWarnings
public void warning(SAXParseException e) throws SAXException
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.
warning in interface ErrorHandlere - The warning information encoded as an exception.SAXException - Any SAX exception, possibly
wrapping another exception.ErrorHandler.warning(org.xml.sax.SAXParseException),
SAXParseExceptionpublic void error(SAXParseException e) throws SAXException
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.
error in interface ErrorHandlere - The warning information encoded as an exception.SAXException - Any SAX exception, possibly
wrapping another exception.ErrorHandler.warning(org.xml.sax.SAXParseException),
SAXParseExceptionpublic void fatalError(SAXParseException e) throws SAXException
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.
fatalError in interface ErrorHandlere - The error information encoded as an exception.SAXException - Any SAX exception, possibly
wrapping another exception.ErrorHandler.fatalError(org.xml.sax.SAXParseException),
SAXParseExceptionprivate static String toString(SAXParseException e)
public int getErrorCount()
public int getWarningCount()
public void printSummary()