textbender.g.xml.sax
Class ErrorHandlerPW

java.lang.Object
  extended by ErrorHandlerPW
All Implemented Interfaces:
ErrorHandler

public final class ErrorHandlerPW
extends Object
implements ErrorHandler

A SAX error handler that outputs messages to a print writer.


Constructor Summary
ErrorHandlerPW(PrintWriter pw)
          Creates an ErrorHandlerPW.
 
Method Summary
 int count()
          Returns the sum of error, fatal error and warning counts.
 void error(SAXParseException x)
          Outputs an error through the print writer.
 void fatalError(SAXParseException x)
          Outputs a fatal error through the print writer.
 int getErrorCount()
          Returns the error count.
 int getFatalErrorCount()
          Returns the fatal error count.
 int getWarningCount()
          Returns the warning count.
 void reset()
          Resets all counts to zero.
 void warning(SAXParseException x)
          Outputs a warning through the print writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorHandlerPW

public ErrorHandlerPW(PrintWriter pw)
Creates an ErrorHandlerPW. If using it repeatedly, call reset() between parses.

Method Detail

count

public int count()
Returns the sum of error, fatal error and warning counts.


getErrorCount

public int getErrorCount()
Returns the error count.


getFatalErrorCount

public int getFatalErrorCount()
Returns the fatal error count.


getWarningCount

public int getWarningCount()
Returns the warning count.


reset

public void reset()
Resets all counts to zero.


error

public void error(SAXParseException x)
Outputs an error through the print writer. Increments the error count.

Specified by:
error in interface ErrorHandler

fatalError

public void fatalError(SAXParseException x)
Outputs a fatal error through the print writer. Increments the fatal error count.

Specified by:
fatalError in interface ErrorHandler

warning

public void warning(SAXParseException x)
Outputs a warning through the print writer. Increments the warning count.

Specified by:
warning in interface ErrorHandler