|
GXPARSE hosted by | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ca.gorman.xml.parse.AbstractMessageListener<T>
public abstract class AbstractMessageListener<T extends Parser>
Listener that reports warnings, recoverable errors, and fatal errors to
a Writer
or to System.err
.
Field Summary | |
---|---|
static int |
ACCEPT_NONE
|
static int |
FATAL_ERROR
|
static int |
RECOVERABLE_ERROR
|
static int |
WARNING
|
Constructor Summary | |
---|---|
protected |
AbstractMessageListener()
Construct on default destination ( System.err ). |
protected |
AbstractMessageListener(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.. |
|
int |
getMaxCount()
Get the number of warnings or errors that will be reported before the next one will stop the parse. |
|
int |
getMaxErrorLevel()
Get the highest error level that will not immediately stop the parse. |
|
static
|
newInstance()
|
|
static
|
newInstance(Writer writer)
|
|
void |
setMaxCount(int i)
Set the number of warnings and errors that will be reported before the next one will stop the parse. |
|
void |
setMaxErrorLevel(int i)
Set the highest level of warning or error that will be accepted without immediately stopping the parse. |
|
void |
warning(T parser,
String description,
Location location,
Exception exception)
Receive notification of a warning.. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ACCEPT_NONE
public static final int WARNING
public static final int RECOVERABLE_ERROR
public static final int FATAL_ERROR
Constructor Detail |
---|
protected AbstractMessageListener(Writer writer)
Construct on a Writer as destination for error messages.
protected AbstractMessageListener()
Construct on default destination (System.err
).
Method Detail |
---|
public static <T extends Parser> AbstractMessageListener<T> newInstance()
public static <T extends Parser> AbstractMessageListener<T> newInstance(Writer writer)
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
.
warning
in interface MessageListener<T extends Parser>
parser
- The Parser
that invoked this
methoddescription
- A summary of the warning information (may be an
empty String).location
- Information about the location in the inputexception
- 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.
ListenerException
IOException
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
.
error
in interface MessageListener<T extends Parser>
parser
- The Parser
that invoked this
methoddescription
- A summary of the warning information (may be an
empty String).location
- Information about the location in the inputexception
- 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.
ListenerException
IOException
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.
fatalError
in interface MessageListener<T extends Parser>
parser
- The Parser
that invoked this
methoddescription
- A summary of the warning information (may be an
empty String).location
- Information about the location in the inputexception
- 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.
ListenerException
IOException
public int getMaxErrorLevel()
Get the highest error level that will not immediately stop the parse.
setMaxErrorLevel(int)
public void setMaxErrorLevel(int i)
Set the highest level of warning or error that will be accepted without immediately stopping the parse. The levels, in increasing order of severity are:
The initial (default) value is AbstractMessageListener.RECOVERABLE_ERROR.
IllegalArgumentException
- if the parameter is not one of the
values above.public int getMaxCount()
Get the number of warnings or errors that will be reported before the next one will stop the parse.
public void setMaxCount(int i)
Set the number of warnings and errors that will be reported before the next one will stop the parse. The initial (default) value is Integer.MAX_VALUE.
i
- an integer zero or greater.
IllegalArgumentException
- if the parameter is a negative integer
|
GXPARSE download | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |