org.weborganic.berlioz.xml
Class SAXErrorCollector

java.lang.Object
  extended by org.weborganic.berlioz.util.ErrorCollector<SAXParseException>
      extended by org.weborganic.berlioz.xml.SAXErrorCollector
All Implemented Interfaces:
ErrorHandler

public final class SAXErrorCollector
extends ErrorCollector<SAXParseException>
implements ErrorHandler

A SAX error handler will collect all the exceptions reported by the SAX parser.

Since:
Berlioz 0.8
Version:
Berlioz 0.8.5 - 15 August 2011
Author:
Christophe Lauret

Constructor Summary
SAXErrorCollector(Logger logger)
          Creates a new Berlioz error handler.
 
Method Summary
 void error(SAXParseException exception)
           
 void fatalError(SAXParseException exception)
           
 void warning(SAXParseException exception)
           
 
Methods inherited from class org.weborganic.berlioz.util.ErrorCollector
collect, collectQuietly, getErrors, hasError, setErrorFlag, setException
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXErrorCollector

public SAXErrorCollector(Logger logger)
Creates a new Berlioz error handler.

Parameters:
logger - A logger to report errors when the SAX methods are called.
Method Detail

fatalError

public void fatalError(SAXParseException exception)
                throws SAXParseException
Specified by:
fatalError in interface ErrorHandler
Parameters:
exception - A SAX parse fatal reported by the SAX parser.
Throws:
SAXParseException - If thrown by the underlying ErrorCollector.
See Also:
ErrorHandler.fatalError(org.xml.sax.SAXParseException)

error

public void error(SAXParseException exception)
           throws SAXParseException
Specified by:
error in interface ErrorHandler
Parameters:
exception - A SAX parse error reported by the SAX parser.
Throws:
SAXParseException - If thrown by the underlying ErrorCollector.
See Also:
ErrorHandler.error(org.xml.sax.SAXParseException)

warning

public void warning(SAXParseException exception)
             throws SAXParseException
Specified by:
warning in interface ErrorHandler
Parameters:
exception - A SAX parse warning reported by the SAX parser.
Throws:
SAXParseException - If thrown by the underlying ErrorCollector.
See Also:
ErrorHandler.warning(org.xml.sax.SAXParseException)