java.lang.Object
com.sun.tools.ws.wscompile.ErrorReceiver
- All Implemented Interfaces:
com.sun.tools.xjc.api.ErrorListener
,com.sun.xml.bind.api.ErrorListener
,ErrorHandler
- Direct Known Subclasses:
ConsoleErrorReporter
,ErrorReceiverFilter
public abstract class ErrorReceiver
extends Object
implements ErrorHandler, com.sun.tools.xjc.api.ErrorListener
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 this 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]), Vivek Pandey
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal void
Reports a debug message to users.abstract void
debug
(SAXParseException exception) 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
Reports a warning.abstract void
warning
(SAXParseException exception)
-
Constructor Details
-
ErrorReceiver
public ErrorReceiver()
-
-
Method Details
-
error
- Parameters:
loc
- can be null if the location is unknown
-
error
-
error
-
error
-
warning
Reports a warning. -
error
- Specified by:
error
in interfaceErrorHandler
- Specified by:
error
in interfacecom.sun.tools.xjc.api.ErrorListener
- Specified by:
error
in interfacecom.sun.xml.bind.api.ErrorListener
- Throws:
AbortException
-
fatalError
- Specified by:
fatalError
in interfaceErrorHandler
- Specified by:
fatalError
in interfacecom.sun.tools.xjc.api.ErrorListener
- Specified by:
fatalError
in interfacecom.sun.xml.bind.api.ErrorListener
- Throws:
AbortException
-
warning
- Specified by:
warning
in interfaceErrorHandler
- Specified by:
warning
in interfacecom.sun.tools.xjc.api.ErrorListener
- Specified by:
warning
in interfacecom.sun.xml.bind.api.ErrorListener
- 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 interfacecom.sun.tools.xjc.api.ErrorListener
- Specified by:
info
in interfacecom.sun.xml.bind.api.ErrorListener
-
debug
Reports a debug message to users.- See Also:
-
debug
-
getLocationString
Returns the human readable string representation of theLocator
part of the specifiedSAXParseException
.- Returns:
- non-null valid object.
-