|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.lib.StandardErrorListener
public class StandardErrorListener
StandardErrorListener is the standard error handler for XSLT and XQuery processing errors, used if no other ErrorListener is nominated.
Field Summary | |
---|---|
protected PrintStream |
errorOutput
|
Constructor Summary | |
---|---|
StandardErrorListener()
Create a Standard Error Listener |
Method Summary | |
---|---|
static String |
abbreviatePath(String uri)
Abbreviate a URI (if requested) |
void |
error(TransformerException exception)
Receive notification of a recoverable error. |
void |
fatalError(TransformerException exception)
Receive notification of a non-recoverable error. |
PrintStream |
getErrorOutput()
Get the error output stream |
static String |
getExpandedMessage(TransformerException err)
Get a string containing the message for this exception and all contained exceptions |
String |
getLocationMessage(TransformerException err)
Get a string identifying the location of an error. |
int |
getRecoveryPolicy()
Get the recovery policy |
StandardErrorListener |
makeAnother(int hostLanguage)
Make a clean copy of this ErrorListener. |
protected void |
outputStackTrace(PrintStream out,
XPathContext context)
Generate a stack trace. |
static void |
printStackTrace(PrintStream out,
XPathContext context)
Print a stack trace to a specified output destination |
void |
setErrorOutput(PrintStream writer)
Set output destination for error messages (default is System.err) |
void |
setRecoveryPolicy(int policy)
Set the recovery policy |
void |
warning(TransformerException exception)
Receive notification of a warning. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected transient PrintStream errorOutput
Constructor Detail |
---|
public StandardErrorListener()
Method Detail |
---|
public StandardErrorListener makeAnother(int hostLanguage)
hostLanguage
- the host language (not used by this implementation)
public void setErrorOutput(PrintStream writer)
writer
- The PrintStream to use for error messagespublic PrintStream getErrorOutput()
public void setRecoveryPolicy(int policy)
policy
- the recovery policy for XSLT recoverable errors. One of
Configuration.RECOVER_SILENTLY
,
Configuration.RECOVER_WITH_WARNINGS
,
Configuration.DO_NOT_RECOVER
.public int getRecoveryPolicy()
Configuration.RECOVER_SILENTLY
,
Configuration.RECOVER_WITH_WARNINGS
,
Configuration.DO_NOT_RECOVER
.public void warning(TransformerException exception) throws TransformerException
Transformers can use this method to report conditions that are not errors or fatal errors. The default behaviour is to take no action.
After invoking this method, the Transformer must continue with the transformation. It should still be possible for the application to process the document through to the end.
warning
in interface ErrorListener
exception
- The warning information encapsulated in a
transformer exception.
TransformerException
- if the application
chooses to discontinue the transformation.TransformerException
public void error(TransformerException exception) throws TransformerException
The transformer 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.
The action of the standard error listener depends on the recovery policy that has been set, which may be one of RECOVER_SILENTLY, RECOVER_WITH_WARNING, or DO_NOT_RECOVER
error
in interface ErrorListener
exception
- The error information encapsulated in a
transformer exception.
TransformerException
- if the application
chooses to discontinue the transformation.TransformerException
public void fatalError(TransformerException exception) throws TransformerException
The application must assume that the transformation cannot continue after the Transformer has invoked this method, and should continue (if at all) only to collect addition error messages. In fact, Transformers are free to stop reporting events once this method has been invoked.
fatalError
in interface ErrorListener
exception
- The error information encapsulated in a
transformer exception.
TransformerException
- if the application
chooses to discontinue the transformation.TransformerException
protected void outputStackTrace(PrintStream out, XPathContext context)
out
- the destination for the stack tracecontext
- the context (which holds the information to be output)public String getLocationMessage(TransformerException err)
err
- the exception containing the location information
public static String abbreviatePath(String uri)
uri
- the URI to be abbreviated
public static String getExpandedMessage(TransformerException err)
err
- the exception containing the required information
public static void printStackTrace(PrintStream out, XPathContext context)
out
- the print stream to which the stack trace will be outputcontext
- the XPath dynamic execution context (which holds the head of a linked
list of context objects, representing the execution stack)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |