public class XPathException extends TransformerException
Modifier and Type | Class and Description |
---|---|
static class |
XPathException.Circularity
Subclass of XPathException used to report circularities
|
Constructor and Description |
---|
XPathException(String message)
Create an XPathException with an error message
|
XPathException(String message,
Location 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,
Location loc)
Create an XPathException that supplies an error message and supplies location information
|
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
|
Modifier and Type | Method and Description |
---|---|
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
|
Sequence |
getErrorObject()
Get the error object associated with this error.
|
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(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(String code)
Set the error code, provided it has not already been set.
|
void |
maybeSetLocation(Location here)
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(Sequence 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 |
setHostLanguage(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
addSuppressed, fillInStackTrace, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, setStackTrace, toString
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, 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(String message, Location 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 contextpublic static XPathException makeXPathException(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 Location getLocator()
getLocator
in class TransformerException
public 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 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(String language)
language
- a value such as "XPath", "XQuery", "XSLT Pattern"public String getHostLanguage()
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(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-2014 Saxonica Limited. All rights reserved.