Package com.sun.tools.ws.wscompile
Class ErrorReceiver
java.lang.Object
com.sun.tools.ws.wscompile.ErrorReceiver
- All Implemented Interfaces:
com.sun.tools.xjc.api.ErrorListener,org.glassfish.jaxb.core.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 (kohsuke.kawaguchi@sun.com), Vivek Pandey
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidReports a debug message to users.abstract voiddebug(SAXParseException exception) voidfinal voidfinal voidfinal voidabstract voiderror(SAXParseException exception) abstract voidfatalError(SAXParseException exception) protected final StringReturns the human readable string representation of theLocatorpart of the specifiedSAXParseException.abstract voidinfo(SAXParseException exception) Reports verbose messages to users.voidThis method will be invoked periodically to allowAbortExceptionto be thrown, especially when this is driven by some kind of GUI.final voidReports a warning.abstract voidwarning(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:
errorin interfaceErrorHandler- Specified by:
errorin interfacecom.sun.tools.xjc.api.ErrorListener- Specified by:
errorin interfaceorg.glassfish.jaxb.core.api.ErrorListener- Throws:
AbortException
-
fatalError
- Specified by:
fatalErrorin interfaceErrorHandler- Specified by:
fatalErrorin interfacecom.sun.tools.xjc.api.ErrorListener- Specified by:
fatalErrorin interfaceorg.glassfish.jaxb.core.api.ErrorListener- Throws:
AbortException
-
warning
- Specified by:
warningin interfaceErrorHandler- Specified by:
warningin interfacecom.sun.tools.xjc.api.ErrorListener- Specified by:
warningin interfaceorg.glassfish.jaxb.core.api.ErrorListener- Throws:
AbortException
-
pollAbort
This method will be invoked periodically to allowAbortExceptionto 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:
infoin interfacecom.sun.tools.xjc.api.ErrorListener- Specified by:
infoin interfaceorg.glassfish.jaxb.core.api.ErrorListener
-
debug
Reports a debug message to users.- See Also:
-
debug
-
getLocationString
Returns the human readable string representation of theLocatorpart of the specifiedSAXParseException.- Returns:
- non-null valid object.
-