GXPARSE hosted by SourceForge.net Logo

ca.gorman.xml.parse
Class AbstractErrorListener<T extends Parser>

java.lang.Object
  extended by ca.gorman.xml.parse.AbstractListener<T>
      extended by ca.gorman.xml.parse.AbstractErrorListener<T>
All Implemented Interfaces:
CharacterListener<T>, DtdListener<T>, ElementListener<T>, EntityListener<T>, Listener<T>, MessageListener<T>, PrefixListener<T>, SkippedEntityListener<T>

public abstract class AbstractErrorListener<T extends Parser>
extends AbstractListener<T>

Listener for warnings, recoverable errors, and fatal errors.


Constructor Summary
protected AbstractErrorListener()
           Construct on default destination (System.err).
protected AbstractErrorListener(Writer writer)
           Construct on a Writer as destination for error messages.
 
Method Summary
 void error(T parser, String description, Location location, Exception exception)
          

Receive notification of a recoverable error..

 void fatalError(T parser, String description, Location location, Exception exception)
          

Receive notification of a non-recoverable error..

static
<T extends Parser>
AbstractErrorListener<T>
newInstance()
           
static
<T extends Parser>
AbstractErrorListener<T>
newInstance(Writer writer)
           
 void warning(T parser, String description, Location location, Exception exception)
          

Receive notification of a warning..

 
Methods inherited from class ca.gorman.xml.parse.AbstractListener
attributeDecl, cdata, characters, comment, doDocument, doDtd, doElement, doEntity, elementDecl, endPrefixMapping, externalEntityDecl, getExternalSubset, ignorableWhitespace, internalEntityDecl, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractErrorListener

protected AbstractErrorListener(Writer writer)

Construct on a Writer as destination for error messages.


AbstractErrorListener

protected AbstractErrorListener()

Construct on default destination (System.err).

Method Detail

newInstance

public static <T extends Parser> AbstractErrorListener<T> newInstance()

newInstance

public static <T extends Parser> AbstractErrorListener<T> newInstance(Writer writer)

warning

public void warning(T parser,
                    String description,
                    Location location,
                    Exception exception)
             throws ListenerException,
                    IOException

Receive notification of a warning..

Reports the warning to System.err.

Specified by:
warning in interface MessageListener<T extends Parser>
Overrides:
warning in class AbstractListener<T extends Parser>
Parameters:
description - A summary of the warning information (may be an empty String).
location - Information about the location in the input
exception - Additional information from the underlying parser. The information will depend on the Parser implementation. The parameter may be null, and the underlying parser may not have actually thrown an exception.
parser - The Parser that invoked this method
Throws:
ListenerException
IOException

error

public void error(T parser,
                  String description,
                  Location location,
                  Exception exception)
           throws ListenerException,
                  IOException

Receive notification of a recoverable error..

Reports the error to System.err.

Specified by:
error in interface MessageListener<T extends Parser>
Overrides:
error in class AbstractListener<T extends Parser>
Parameters:
description - A summary of the warning information (may be an empty String).
location - Information about the location in the input
exception - Additional information from the underlying parser. The information will depend on the Parser implementation. The parameter may be null, and the underlying parser may not have actually thrown an exception.
parser - The Parser that invoked this method
Throws:
ListenerException
IOException

fatalError

public void fatalError(T parser,
                       String description,
                       Location location,
                       Exception exception)
                throws ListenerException,
                       IOException

Receive notification of a non-recoverable error..

Reports the fatal error to System.err and throws ListenerException with exception as the cause.

Specified by:
fatalError in interface MessageListener<T extends Parser>
Overrides:
fatalError in class AbstractListener<T extends Parser>
Parameters:
description - A summary of the warning information (may be an empty String).
location - Information about the location in the input
exception - Additional information from the underlying parser. The information will depend on the Parser implementation. The parameter may be null, and the underlying parser may not have actually thrown an exception.
parser - The Parser that invoked this method
Throws:
ListenerException
IOException

GXPARSE download

GXPARSE Generic XML Stream Parser API and supporting tools.   Release $Name: gxparse-sf-alpha-2_0 $
Copyright 2003-2004 Ian E. Gorman
Released under GNU Lesser General Public License