public class XPathException
extends javax.xml.transform.TransformerException
Modifier and Type | Class and Description |
---|---|
static class |
XPathException.Circularity
Subclass of XPathException used to report circularities
|
static class |
XPathException.StackOverflow
Subclass of XPathException used to report that stack overflow was detected
|
Constructor and Description |
---|
XPathException(java.lang.String message)
Create an XPathException with an error message
|
XPathException(java.lang.String message,
Location loc,
java.lang.Throwable err)
Create an XPathException that supplies an error message and wraps an underlying exception
and supplies location information
|
XPathException(java.lang.String message,
java.lang.String errorCode)
Create an XPathException that supplies an error message and an error code
|
XPathException(java.lang.String message,
java.lang.String errorCode,
Location loc)
Create an XPathException that supplies an error message and supplies location information
|
XPathException(java.lang.String message,
java.lang.String errorCode,
XPathContext context)
Create an XPathException that supplies an error message and an error code and provides the
dynamic context
|
XPathException(java.lang.String message,
java.lang.Throwable err)
Create an XPathException that supplies an error message and wraps an underlying exception
|
XPathException(java.lang.Throwable err)
Create an XPathException that wraps another exception
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getErrorCodeLocalPart()
Get the local part of the name of the error code
|
java.lang.String |
getErrorCodeNamespace()
Get the namespace URI part of the name of the error code
|
StructuredQName |
getErrorCodeQName()
Get the error code as a QName
|
Sequence<?> |
getErrorObject()
Get the error object associated with this error.
|
Expression |
getFailingExpression() |
java.lang.String |
getHostLanguage()
Get the host language code
|
Location |
getLocator()
Method getLocator retrieves an instance of a SourceLocator
object that specifies where an error occured.
|
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 |
isSyntaxError()
Ask whether this exception represents a syntax error
|
boolean |
isTypeError()
Ask whether this exception represents a type error
|
static XPathException |
makeXPathException(java.lang.Exception err)
Create an XPathException from an exception of another kind.
|
void |
maybeSetContext(XPathContext context)
Set the context of a message, only if it is not already set
|
void |
maybeSetErrorCode(java.lang.String code)
Set the error code, provided it has not already been set.
|
void |
maybeSetFailingExpression(Expression failingExpression) |
void |
maybeSetLocation(Location here)
Set the location of a message, only if it is not already set
|
void |
setErrorCode(java.lang.String code)
Set the error code.
|
void |
setErrorCodeQName(StructuredQName code)
Set the error code.
|
void |
setErrorObject(Sequence<?> value)
Set the error object associated with this error.
|
void |
setFailingExpression(Expression failingExpression) |
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 |
setHostLanguage(java.lang.String language)
Set the host language code
|
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 |
setIsSyntaxError(boolean is)
Mark this exception to indicate that it represents (or does not represent) a syntax error
|
void |
setIsTypeError(boolean is)
Mark this exception to indicate that it represents (or does not represent) a type error
|
void |
setLocation(Location loc) |
void |
setXPathContext(XPathContext context)
Set dynamic context information in the exception object
|
getCause, getException, getLocationAsString, getMessageAndLocation, initCause, printStackTrace, printStackTrace, printStackTrace, setLocator
public XPathException(java.lang.String message)
message
- the message explaining what is wrong. This should not include location information.public XPathException(java.lang.Throwable err)
err
- the wrapped error or exceptionpublic XPathException(java.lang.String message, java.lang.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(java.lang.String message, java.lang.String errorCode, Location loc)
message
- the error messageloc
- indicates where in the user-written query or stylesheet (or sometimes in a source
document) the error occurredpublic XPathException(java.lang.String message, Location loc, java.lang.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(java.lang.String message, java.lang.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(java.lang.String message, java.lang.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 contextpublic static XPathException makeXPathException(java.lang.Exception err)
err
- the supplied Exceptionpublic void setXPathContext(XPathContext context)
context
- the dynamic context at the time the exception occurredpublic void setLocation(Location loc)
public Expression getFailingExpression()
public void setFailingExpression(Expression failingExpression)
public void maybeSetFailingExpression(Expression failingExpression)
public Location getLocator()
getLocator
in class javax.xml.transform.TransformerException
public XPathContext getXPathContext()
public void setIsStaticError(boolean is)
is
- true if this exception is a static errorpublic boolean isStaticError()
public void setIsSyntaxError(boolean is)
is
- true if this exception is a syntax errorpublic boolean isSyntaxError()
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 setHostLanguage(java.lang.String language)
language
- a value such as "XPath", "XQuery", "XSLT Pattern"public java.lang.String getHostLanguage()
public void setErrorCode(java.lang.String code)
NamespaceConstant.ERR
code
- The local part of the name of the error codepublic void maybeSetErrorCode(java.lang.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 java.lang.String getErrorCodeLocalPart()
public java.lang.String getErrorCodeNamespace()
public void setErrorObject(Sequence<?> value)
value
- the error object, as supplied to the fn:error() functionpublic Sequence<?> getErrorObject()
public void setHasBeenReported(boolean reported)
reported
- true if the error has been reported to the error listenerpublic boolean hasBeenReported()
public void maybeSetLocation(Location here)
here
- the current location (or null)public void maybeSetContext(XPathContext context)
context
- the current XPath context (or null)public boolean isReportableStatically()
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.