org.openxml.parser
Interface ErrorSinkHandler


Deprecated. This class has been deprecated and no longer supported. It will be removed in release 1.1. Use ErrorHandler instead.

public abstract interface ErrorSinkHandler

Defines an interface for reporting errors to an external parser. When an entity is parsed, errors must still be directed to the document parser. This is done by specifying the document parser as the error sink for the entity parser. The error(short, java.lang.String) methods of the document parser are then called for each error issued by the entity parser.

Version:
$Revision: 1.3 $ $Date: 1999/04/18 01:52:13 $
Author:
Assaf Arkin
See Also:
SourceLocation, ParseException, Parser

Method Summary
 void error(java.lang.Exception except)
          Deprecated. Generates an exception of type FatalParseException to encapsulate an underlying I/O or runtime exception and throws that exception immediately.
 void error(short severity, java.lang.String message)
          Deprecated. Issues an error by the parser.
 

Method Detail

error

public void error(short severity,
                  java.lang.String message)
           throws ParseException
Deprecated. 
Issues an error by the parser. The error is encapsulated in one of three exception classes, depending on it's severity:

The exception is then either thrown or stored. Exceptions of fatal severity are always thrown. Exceptions of well formed severity are thrown if the severity level has been set to Parser.STOP_SEVERITY_WELL_FORMED. Exceptions of validity are thrown in the severity level has been set to either Parser.STOP_SEVERITY_VALIDITY or to Parser.STOP_SEVERITY_WELL_FORMED.

Exceptions that are not thrown are stored and may be retrieved by calling Parser.getLastException() to retrieve the last stored exceptions. Previous exceptions are retrieved by recursively calling ParseException.getPrevious(). The error location is obtained by calling one of the SourceLocation methods on each exception.

This mechanism has been devised to allow the parser to fully read invalid and not well-formed documents into memory and still report errors back to the applications.

Parameters:
severity - The severity of the exception
message - A descriptive message
Throws:
ParseException - A parsing error has been encountered, and based on it severity, an exception is thrown to terminate parsing

error

public void error(java.lang.Exception except)
           throws ParseException
Deprecated. 
Generates an exception of type FatalParseException to encapsulate an underlying I/O or runtime exception and throws that exception immediately.
Parameters:
except - The underlying exception
Throws:
ParseException - A parsing error has been encountered, and based on it severity, an exception is thrown to terminate parsing