Package com.sun.tools.ws.wscompile
Class ErrorReceiver
- java.lang.Object
-
- com.sun.tools.ws.wscompile.ErrorReceiver
-
- All Implemented Interfaces:
ErrorListener,com.sun.xml.bind.api.ErrorListener,ErrorHandler
- Direct Known Subclasses:
ConsoleErrorReporter,ErrorReceiverFilter
public abstract class ErrorReceiver extends Object implements ErrorHandler, ErrorListener
Implemented by the driver of the compiler engine to handle errors found during the compiliation.This class implements
ErrorHandlerso it can be passed to anywhere whereErrorHandleris 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 throwsAbortException, which is unchecked.This also implements the externally visible
ErrorListenerso that we can reuse our internal implementation for testing and such.- Author:
- Kohsuke Kawaguchi (kohsuke.kawaguchi@sun.com), Vivek Pandey
-
-
Constructor Summary
Constructors Constructor Description ErrorReceiver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voiddebug(String msg)Reports a debug message to users.abstract voiddebug(SAXParseException exception)voiderror(Exception e)voiderror(String msg, Exception e)voiderror(Locator loc, String msg)voiderror(Locator loc, String msg, Exception e)abstract voiderror(SAXParseException exception)abstract voidfatalError(SAXParseException exception)protected StringgetLocationString(SAXParseException e)Returns the human readable string representation of theLocatorpart of the specifiedSAXParseException.abstract voidinfo(SAXParseException exception)Reports verbose messages to users.voidpollAbort()This method will be invoked periodically to allowAbortExceptionto be thrown, especially when this is driven by some kind of GUI.voidwarning(Locator loc, String msg)Reports a warning.abstract voidwarning(SAXParseException exception)
-
-
-
Method Detail
-
error
public final void error(Locator loc, String msg)
- Parameters:
loc- can be null if the location is unknown
-
error
public void error(Exception e)
-
error
public abstract void error(SAXParseException exception) throws AbortException
- Specified by:
errorin interfaceErrorHandler- Specified by:
errorin interfaceErrorListener- Specified by:
errorin interfacecom.sun.xml.bind.api.ErrorListener- Throws:
AbortException
-
fatalError
public abstract void fatalError(SAXParseException exception) throws AbortException
- Specified by:
fatalErrorin interfaceErrorHandler- Specified by:
fatalErrorin interfaceErrorListener- Specified by:
fatalErrorin interfacecom.sun.xml.bind.api.ErrorListener- Throws:
AbortException
-
warning
public abstract void warning(SAXParseException exception) throws AbortException
- Specified by:
warningin interfaceErrorHandler- Specified by:
warningin interfaceErrorListener- Specified by:
warningin interfacecom.sun.xml.bind.api.ErrorListener- Throws:
AbortException
-
pollAbort
public void pollAbort() throws AbortExceptionThis method will be invoked periodically to allowAbortExceptionto be thrown, especially when this is driven by some kind of GUI.- Throws:
AbortException
-
info
public abstract void info(SAXParseException exception)
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 interfaceErrorListener- Specified by:
infoin interfacecom.sun.xml.bind.api.ErrorListener
-
debug
public final void debug(String msg)
Reports a debug message to users.- See Also:
info(SAXParseException)
-
debug
public abstract void debug(SAXParseException exception)
-
getLocationString
protected final String getLocationString(SAXParseException e)
Returns the human readable string representation of theLocatorpart of the specifiedSAXParseException.- Returns:
- non-null valid object.
-
-