public abstract class ErrorReceiver extends Object implements ErrorHandler, com.sun.tools.xjc.api.ErrorListener
This class implements ErrorHandler so it can be
passed to anywhere where ErrorHandler is expected.
However, to make the error handling easy (and make it work
with visitor patterns nicely),
none of the methods on thi class throws SAXException.
Instead, when the compilation needs to be aborted,
it throws AbortException, which is unchecked.
This also implements the externally visible ErrorListener
so that we can reuse our internal implementation for testing and such.
| Constructor and Description |
|---|
ErrorReceiver() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
debug(SAXParseException exception) |
void |
debug(String msg)
Reports a debug message to users.
|
void |
error(Exception e) |
void |
error(Locator loc,
String msg) |
void |
error(Locator loc,
String msg,
Exception e) |
abstract void |
error(SAXParseException exception) |
void |
error(String msg,
Exception e) |
abstract void |
fatalError(SAXParseException exception) |
protected String |
getLocationString(SAXParseException e)
Returns the human readable string representation of the
Locator part of the specified
SAXParseException. |
abstract void |
info(SAXParseException exception)
Reports verbose messages to users.
|
void |
pollAbort()
This method will be invoked periodically to allow
AbortException
to be thrown, especially when this is driven by some kind of GUI. |
void |
warning(Locator loc,
String msg)
Reports a warning.
|
abstract void |
warning(SAXParseException exception) |
public final void error(Locator loc, String msg)
loc - can be null if the location is unknownpublic void error(Exception e)
public abstract void error(SAXParseException exception) throws AbortException
error in interface com.sun.xml.bind.api.ErrorListenererror in interface ErrorHandlerAbortExceptionpublic abstract void fatalError(SAXParseException exception) throws AbortException
fatalError in interface com.sun.xml.bind.api.ErrorListenerfatalError in interface ErrorHandlerAbortExceptionpublic abstract void warning(SAXParseException exception) throws AbortException
warning in interface com.sun.xml.bind.api.ErrorListenerwarning in interface ErrorHandlerAbortExceptionpublic void pollAbort()
throws AbortException
AbortException
to be thrown, especially when this is driven by some kind of GUI.AbortExceptionpublic abstract void info(SAXParseException exception)
info in interface com.sun.xml.bind.api.ErrorListenerpublic final void debug(String msg)
info(SAXParseException)public abstract void debug(SAXParseException exception)
protected final String getLocationString(SAXParseException e)
Locator part of the specified
SAXParseException.Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.