org.n52.security.common.xml
Class QuietErrorHandler

java.lang.Object
  extended by org.n52.security.common.xml.QuietErrorHandler
All Implemented Interfaces:
ErrorHandler

public class QuietErrorHandler
extends Object
implements ErrorHandler

Collects all errors thrown by a parser, but never rethrows them.

A client can use one of the is* and get* methods to retrieve the thrown warnings, errors and fatal errors.

The handler also logs the errors, but only on debug level, because a client shall evaluate the errors and properly react on them.

Version:
$Revision: $
Author:
Marko Reiprecht Created on 22.03.2008

Constructor Summary
QuietErrorHandler()
           
 
Method Summary
 void error(SAXParseException exception)
          Handles the errors.
 void fatalError(SAXParseException exception)
          Handles the fatal errors.
 Iterator<Exception> getErrors()
           
 Iterator<Exception> getFatalErrors()
           
 Iterator<Exception> getWarnings()
           
 boolean isEmpty()
          Method checks if warnings, errors or fatal errors are collected.
 boolean isError()
          Checks if errors are collected.
 boolean isFatalErrors()
          Checks if fatal errors are collected.
 boolean isWarning()
          Checks if warnings are collected.
 void reset()
          Method resets the internal state, so it is possible to use an instance many times.
 void warning(SAXParseException exception)
          Handles the warning exceptions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuietErrorHandler

public QuietErrorHandler()
Method Detail

getErrors

public Iterator<Exception> getErrors()

getWarnings

public Iterator<Exception> getWarnings()

isEmpty

public boolean isEmpty()
Method checks if warnings, errors or fatal errors are collected.

Returns:
boolean.

isError

public boolean isError()
Checks if errors are collected.

Returns:
boolean.

isFatalErrors

public boolean isFatalErrors()
Checks if fatal errors are collected.

Returns:
boolean.

getFatalErrors

public Iterator<Exception> getFatalErrors()

isWarning

public boolean isWarning()
Checks if warnings are collected.

Returns:
boolean.

error

public void error(SAXParseException exception)
           throws SAXException
Handles the errors.

Specified by:
error in interface ErrorHandler
Parameters:
exception - the exception.
Throws:
SAXException - if error occurs.

fatalError

public void fatalError(SAXParseException exception)
                throws SAXException
Handles the fatal errors.

Specified by:
fatalError in interface ErrorHandler
Parameters:
exception - the exception.
Throws:
SAXException - if error occurs.

warning

public void warning(SAXParseException exception)
             throws SAXException
Handles the warning exceptions.

Specified by:
warning in interface ErrorHandler
Parameters:
exception - the exception.
Throws:
SAXException - if error occurs.

reset

public void reset()
Method resets the internal state, so it is possible to use an instance many times.



Copyright © 2004–2013 52north.org. All rights reserved.