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 org..
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.
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| public final void | |
| public final void | |
| public final void | |
| public final void | |
| public void | |
| public abstract void | error(SAXParseException exception)
Redeclares org. Receive notification of a recoverable error. |
| public abstract void | fatalError(SAXParseException exception)
Redeclares org. Receive notification of a non-recoverable, fatal error. |
| protected final String | Returns: non-null valid object.Returns the human readable string representation of the
|
| private String | |
| public abstract void | info(SAXParseException exception)
Redeclares com. Reports verbose messages to users. |
| public void | pollAbort()
This method will be invoked periodically to allow |
| public final void | |
| public abstract void | warning(SAXParseException exception)
Redeclares org. Receive notification of a warning. |
| ErrorReceiver | back to summary |
|---|---|
| protected ErrorReceiver() Default constructor. | |
| debug | back to summary |
|---|---|
| public final void debug(String msg) Reports a debug message to users.
| |
| error | back to summary |
|---|---|
public final void error(Locator loc, String msg)
| |
| error | back to summary |
|---|---|
| public final void error(Locator loc, String msg, Exception e) | |
| error | back to summary |
|---|---|
| public final void error(String msg, Exception e) | |
| error | back to summary |
|---|---|
| public void error(Exception e) | |
| error | back to summary |
|---|---|
| public abstract void error(SAXParseException exception) throws AbortException Redeclares org. Doc from org. Receive notification of a recoverable error. This corresponds to the definition of "error" in section 1.2 of the W3C XML 1.0 Recommendation. For example, a validating parser would use this callback to report the violation of a validity constraint. The default behaviour is to take no action. The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. If the application cannot do so, then the parser should report a fatal error even if the XML recommendation does not require it to do so. Filters may use this method to report other, non-XML errors as well.
| |
| fatalError | back to summary |
|---|---|
| public abstract void fatalError(SAXParseException exception) throws AbortException Redeclares org. Doc from org. Receive notification of a non-recoverable, fatal error. As defined in section 1.2 of the W3C XML 1.0 Recommendation, fatal errors are those that would make it impossible for a parser to continue normal processing. These include violation of a well-formedness constraint, invalid encoding, and forbidden structural errors as described in the W3C XML 1.0 Recommendation.
| |
| getLocationString | back to summary |
|---|---|
| protected final String getLocationString(SAXParseException e) Returns the human readable string representation of the
| |
| getShortName | back to summary |
|---|---|
| private String getShortName(String url) Computes a short name of a given URL for display. | |
| info | back to summary |
|---|---|
| public abstract void info(SAXParseException exception) Redeclares com. 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.
| |
| pollAbort | back to summary |
|---|---|
| public void pollAbort() throws AbortException This method will be invoked periodically to allow | |
| warning | back to summary |
|---|---|
public final void warning(Locator loc, String msg)
| |
| warning | back to summary |
|---|---|
| public abstract void warning(SAXParseException exception) throws AbortException Redeclares org. Doc from org. Receive notification of a warning. SAX parsers will use this method to report conditions that are not errors or fatal errors as defined by the XML recommendation. The default behaviour is to take no action. The SAX parser must continue to provide normal parsing events after invoking this method: it should still be possible for the application to process the document through to the end. Filters may use this method to report other, non-XML warnings as well.
| |