|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception javax.xml.transform.TransformerException net.sf.saxon.trans.XPathException
public class XPathException
XPathException is used to indicate an error in an XPath expression. It will generally be either a StaticError or a DynamicError; ValidationExceptions (arising from schema validation) form a third category
Nested Class Summary | |
---|---|
static class |
XPathException.Circularity
Subclass of XPathException used to report circularities |
Constructor Summary | |
---|---|
XPathException(String message)
Create an XPathException with an error message |
|
XPathException(String message,
SourceLocator loc)
Create an XPathException that supplies an error message and supplies location information |
|
XPathException(String message,
SourceLocator loc,
Throwable err)
Create an XPathException that supplies an error message and wraps an underlying exception and supplies location information |
|
XPathException(String message,
String errorCode)
Create an XPathException that supplies an error message and an error code |
|
XPathException(String message,
String errorCode,
XPathContext context)
Create an XPathException that supplies an error message and an error code and provides the dynamic context |
|
XPathException(String message,
Throwable err)
Create an XPathException that supplies an error message and wraps an underlying exception |
|
XPathException(Throwable err)
Create an XPathException that wraps another exception |
Method Summary | |
---|---|
String |
getAdditionalLocationText()
Get the additional location text, if any. |
String |
getErrorCodeLocalPart()
Get the local part of the name of the error code |
String |
getErrorCodeNamespace()
Get the namespace URI part of the name of the error code |
StructuredQName |
getErrorCodeQName()
Get the error code as a QName |
Value |
getErrorObject()
Get the error object associated with this error. |
XPathContext |
getXPathContext()
Get the dynamic context at the time the exception occurred |
boolean |
hasBeenReported()
Ask whether this error is marked to indicate that it has already been reported to the error listener, and should not be reported again |
boolean |
isGlobalError()
Ask whether this exception originated while evaluating a global variable reference, and is therefore to be reported regardless of the try/catch context surrounding the variable reference |
boolean |
isReportableStatically()
Tests whether this is a dynamic error that may be reported statically if it is detected statically |
boolean |
isStaticError()
Ask whether this exception represents a static error |
boolean |
isTypeError()
Ask whether this exception represents a type error |
XPathException |
makeStatic()
Force an exception to a static error |
static XPathException |
makeXPathException(TransformerException err)
Create an XPathException from a JAXP TransformerException. |
void |
maybeSetContext(XPathContext context)
Set the context of a message, only if it is not already set |
void |
maybeSetErrorCode(String code)
Set the error code, provided it has not already been set. |
void |
maybeSetLocation(SourceLocator locator)
Set the location of a message, only if it is not already set |
void |
setAdditionalLocationText(String text)
Set additional location text. |
void |
setErrorCode(String code)
Set the error code. |
void |
setErrorCodeQName(StructuredQName code)
Set the error code. |
void |
setErrorObject(Value value)
Set the error object associated with this error. |
void |
setHasBeenReported(boolean reported)
Mark this error to indicate that it has already been reported to the error listener, and should not be reported again |
void |
setIsGlobalError(boolean is)
Mark this exception to indicate that it originated while evaluating a global variable reference, and is therefore to be reported regardless of the try/catch context surrounding the variable reference |
void |
setIsStaticError(boolean is)
Mark this exception to indicate that it represents (or does not represent) a static error |
void |
setIsTypeError(boolean is)
Mark this exception to indicate that it represents (or does not represent) a type error |
void |
setXPathContext(XPathContext context)
Set dynamic context information in the exception object |
Methods inherited from class javax.xml.transform.TransformerException |
---|
getCause, getException, getLocationAsString, getLocator, getMessageAndLocation, initCause, printStackTrace, printStackTrace, printStackTrace, setLocator |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XPathException(String message)
message
- the message explaining what is wrong. This should not include location information.public XPathException(Throwable err)
err
- the wrapped error or exceptionpublic XPathException(String message, Throwable err)
message
- the error message (which should generally explain what Saxon was doing when the
underlying exception occurred)err
- the underlying exception (the cause of this exception)public XPathException(String message, SourceLocator loc)
message
- the error messageloc
- indicates where in the user-written query or stylesheet (or sometimes in a source
document) the error occurredpublic XPathException(String message, SourceLocator loc, Throwable err)
message
- the error message (which should generally explain what Saxon was doing when the
underlying exception occurred)loc
- indicates where in the user-written query or stylesheet (or sometimes in a source
document) the error occurrederr
- the underlying exception (the cause of this exception)public XPathException(String message, String errorCode)
message
- the error messageerrorCode
- the error code - an eight-character code, which is taken to be in the standard
system error code namespacepublic XPathException(String message, String errorCode, XPathContext context)
message
- the error messageerrorCode
- the error code - an eight-character code, which is taken to be in the standard
system error code namespacecontext
- the dynamic evaluation contextMethod Detail |
---|
public static XPathException makeXPathException(TransformerException err)
err
- the supplied JAXP TransformerException
public XPathException makeStatic()
public void setXPathContext(XPathContext context)
context
- the dynamic context at the time the exception occurredpublic XPathContext getXPathContext()
public void setAdditionalLocationText(String text)
text
- additional information about the location of the error, designed to be output
as a prefix to the error message if desired. (It is not concatenated with the message, because
it may be superfluous in an IDE environment.)public String getAdditionalLocationText()
public void setIsStaticError(boolean is)
is
- true if this exception is a static errorpublic boolean isStaticError()
public void setIsTypeError(boolean is)
is
- true if this exception is a type errorpublic boolean isTypeError()
public void setIsGlobalError(boolean is)
is
- true if this exception is a global variable errorpublic boolean isGlobalError()
public void setErrorCode(String code)
NamespaceConstant.ERR
code
- The local part of the name of the error codepublic void maybeSetErrorCode(String code)
NamespaceConstant.ERR
code
- The local part of the name of the error codepublic void setErrorCodeQName(StructuredQName code)
code
- The error code as a QNamepublic StructuredQName getErrorCodeQName()
public String getErrorCodeLocalPart()
public String getErrorCodeNamespace()
public void setErrorObject(Value value)
value
- the error object, as supplied to the fn:error() functionpublic Value getErrorObject()
public void setHasBeenReported(boolean reported)
reported
- true if the error has been reported to the error listenerpublic boolean hasBeenReported()
public void maybeSetLocation(SourceLocator locator)
locator
- the current location (or null)public void maybeSetContext(XPathContext context)
context
- the current XPath context (or null)public boolean isReportableStatically()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |