|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ErrorHandler
instead.
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.
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 |
public void error(short severity, java.lang.String message) throws ParseException
FatalParseException
for Parser.ERROR_FATAL
severity
WellFormedException
for Parser.ERROR_WELL_FORMED
severity
ValidityException
for Parser.ERROR_VALIDITY
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.
severity
- The severity of the exceptionmessage
- A descriptive messagepublic void error(java.lang.Exception except) throws ParseException
FatalParseException
to encapsulate
an underlying I/O or runtime exception and throws that exception immediately.except
- The underlying exception
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |