cdox.util
Class XMLErrorHandler

java.lang.Object
  extended bycdox.util.XMLErrorHandler
All Implemented Interfaces:
org.xml.sax.ErrorHandler

public class XMLErrorHandler
extends java.lang.Object
implements org.xml.sax.ErrorHandler

This class can be used as general error handler if one wants to know about the errors but not to take an action if any error occurs. The complete errors can be asked about after parsing (possibly also while parsing).

Version:
May 22nd 2002
Author:
Rutger Bezema, Andreas Schmitz

Constructor Summary
XMLErrorHandler()
           
 
Method Summary
 void error(org.xml.sax.SAXParseException e)
           
 void fatalError(org.xml.sax.SAXParseException e)
           
 java.util.Iterator getErrors()
          Returns the errors as string objects in an iterator.
 java.util.Iterator getFatalErrors()
          Returns the fatal errors as string objects in an iterator.
 int getNumberOfErrors()
          Returns the number of errors.
 int getNumberOfFatalErrors()
          Returns the number of fatal errors.
 int getNumberOfWarnings()
          Returns the number of warnings.
 java.util.Iterator getWarnings()
          Returns the warnings as string objects in an iterator.
 boolean validated()
          Returns true, if no errors, fatal errors and warnings occured.
 void warning(org.xml.sax.SAXParseException e)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLErrorHandler

public XMLErrorHandler()
Method Detail

error

public void error(org.xml.sax.SAXParseException e)
Specified by:
error in interface org.xml.sax.ErrorHandler

fatalError

public void fatalError(org.xml.sax.SAXParseException e)
Specified by:
fatalError in interface org.xml.sax.ErrorHandler

warning

public void warning(org.xml.sax.SAXParseException e)
Specified by:
warning in interface org.xml.sax.ErrorHandler

getNumberOfErrors

public int getNumberOfErrors()
Returns the number of errors.

Returns:
the number.

getNumberOfFatalErrors

public int getNumberOfFatalErrors()
Returns the number of fatal errors.

Returns:
the number.

getNumberOfWarnings

public int getNumberOfWarnings()
Returns the number of warnings.

Returns:
the number.

validated

public boolean validated()
Returns true, if no errors, fatal errors and warnings occured.

Returns:
false otherwise.

getErrors

public java.util.Iterator getErrors()
Returns the errors as string objects in an iterator.

Returns:
an Iterator value.

getFatalErrors

public java.util.Iterator getFatalErrors()
Returns the fatal errors as string objects in an iterator.

Returns:
an Iterator value.

getWarnings

public java.util.Iterator getWarnings()
Returns the warnings as string objects in an iterator.

Returns:
an Iterator value.