Package com.sun.tools.xjc
Class ErrorReceiver
java.lang.Object
com.sun.tools.xjc.ErrorReceiver
- All Implemented Interfaces:
ErrorListener,com.sun.xml.bind.api.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 (kohsuke.kawaguchi@sun.com)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidReports a debug message to users.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 voidabstract 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
- Parameters:
loc- can be null if the location is unknown
-
error
- Specified by:
errorin interfaceErrorHandler- Specified by:
errorin interfaceErrorListener- Specified by:
errorin interfacecom.sun.xml.bind.api.ErrorListener- Throws:
AbortException
-
fatalError
- Specified by:
fatalErrorin interfaceErrorHandler- Specified by:
fatalErrorin interfaceErrorListener- Specified by:
fatalErrorin interfacecom.sun.xml.bind.api.ErrorListener- Throws:
AbortException
-
warning
- Specified by:
warningin interfaceErrorHandler- Specified by:
warningin interfaceErrorListener- Specified by:
warningin interfacecom.sun.xml.bind.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 interfaceErrorListener- Specified by:
infoin interfacecom.sun.xml.bind.api.ErrorListener
-
debug
Reports a debug message to users.- See Also:
-
getLocationString
Returns the human readable string representation of theLocatorpart of the specifiedSAXParseException.- Returns:
- non-null valid object.
-