Package com.sun.tools.xjc
Class ErrorReceiver
java.lang.Object
com.sun.tools.xjc.ErrorReceiver
- All Implemented Interfaces:
ErrorListener
,ErrorListener
,ErrorHandler
- Direct Known Subclasses:
ConsoleErrorReporter
,ErrorReceiverFilter
,SchemaCompilerImpl
Implemented by the driver of the compiler engine to handle
errors found during the compiliation.
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.
- Author:
- Kohsuke Kawaguchi ([email protected])
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
Reports a debug message to users.void
final void
final void
final void
abstract void
error
(SAXParseException exception) abstract void
fatalError
(SAXParseException exception) protected final String
Returns the human readable string representation of theLocator
part of the specifiedSAXParseException
.abstract void
info
(SAXParseException exception) Reports verbose messages to users.void
This method will be invoked periodically to allowAbortException
to be thrown, especially when this is driven by some kind of GUI.final void
abstract void
warning
(SAXParseException exception)
-
Constructor Details
-
ErrorReceiver
protected ErrorReceiver()Default constructor.
-
-
Method Details
-
error
- Parameters:
loc
- can be null if the location is unknown
-
error
-
error
-
error
-
warning
- Parameters:
loc
- can be null if the location is unknown
-
error
- Specified by:
error
in interfaceErrorHandler
- Specified by:
error
in interfaceErrorListener
- Specified by:
error
in interfaceErrorListener
- Throws:
AbortException
-
fatalError
- Specified by:
fatalError
in interfaceErrorHandler
- Specified by:
fatalError
in interfaceErrorListener
- Specified by:
fatalError
in interfaceErrorListener
- Throws:
AbortException
-
warning
- Specified by:
warning
in interfaceErrorHandler
- Specified by:
warning
in interfaceErrorListener
- Specified by:
warning
in interfaceErrorListener
- Throws:
AbortException
-
pollAbort
This method will be invoked periodically to allowAbortException
to be thrown, especially when this is driven by some kind of GUI.- Throws:
AbortException
-
info
Reports verbose messages to users. This method can be used to report additional non-essential messages. The implementation usually discards them unless some specific debug option is turned on.- Specified by:
info
in interfaceErrorListener
- Specified by:
info
in interfaceErrorListener
-
debug
Reports a debug message to users.- See Also:
-
getLocationString
Returns the human readable string representation of theLocator
part of the specifiedSAXParseException
.- Returns:
- non-null valid object.
-