Package javax.xml.xquery
Class XQQueryException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- javax.xml.xquery.XQException
-
- javax.xml.xquery.XQQueryException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
XQCancelledException
public class XQQueryException extends XQException
An exception that provides information on errors occurring during the evaluation of an xquery.
EachXQQueryExceptionprovides several kinds of optional information, in addition to the properties inherited fromXQException:- an error code. This
QNameidentifies the error according to the standard as described in Appendix F, XQuery 1.0: An XML Query language, Appendix C, XQuery 1.0 and XPath 2.0 Functions and Operators, and and its associated specifications; implementation-defined errors may be raised. - a position. This identifies the character position of the failing expression in
the query text. This is a
0based position.-1if unknown. - the line number in the query string where the error occured. Line numbering
starts at
1.-1if unknown - the column number in the query string where the error occured. Column numbering
starts at
1.-1if unknown - the module uri. This identifies the module in which the error
occurred,
nullwhen the error is located in the main module. - the XQuery error object of this exception. This is the
$error-objectargument specified through thefn:error()function. May benullif not specified. - the XQuery stack trace. This provides additional dynamic information where the exception occurred in the XQuery expression.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description XQQueryException(java.lang.String message)Constructs anXQQueryExceptionobject with a given message.XQQueryException(java.lang.String message, java.lang.String vendorCode, javax.xml.namespace.QName errorCode, int line, int column, int position)Constructs anXQQueryExceptionobject with a given message, vendor code, error code, line number, column number, and position.XQQueryException(java.lang.String message, java.lang.String vendorCode, javax.xml.namespace.QName errorCode, int line, int column, int position, java.lang.String moduleURI, XQSequence errorObject, XQStackTraceElement[] stackTrace)Constructs anXQQueryExceptionobject with a given message, vendor code, error code, line number, column number, position, module URI, error object, and stack trace.XQQueryException(java.lang.String message, javax.xml.namespace.QName errorCode)Constructs anXQQueryExceptionobject with a given message, and error code.XQQueryException(java.lang.String message, javax.xml.namespace.QName errorCode, int line, int column, int position)Constructs anXQQueryExceptionobject with a given message, error code, line number, column number, and position.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetColumnNumber()Gets the column number in the query string where the error occurred.javax.xml.namespace.QNamegetErrorCode()Gets the code identifying the error according to the standard as described in Appendix F, XQuery 1.0: An XML Query language, Appendix C, XQuery 1.0 and XPath 2.0 Functions and Operators, and its associated specifications; imlementation-defined errors may also be raised; finally the error code may also be specified in the query usingfn:error().XQSequencegetErrorObject()Gets anXQSequencerepresenting the error object passed tofn:error().intgetLineNumber()Gets the line number in the query string where the error occurred.java.lang.StringgetModuleURI()Gets the module URI of the module in which the error occurred.intgetPosition()Gets the character position in the query string where this exception occurred.XQStackTraceElement[]getQueryStackTrace()Returns the query stack stackTrace when the exception occurred, or null if none.-
Methods inherited from class javax.xml.xquery.XQException
getNextException, getVendorCode, setNextException
-
-
-
-
Constructor Detail
-
XQQueryException
public XQQueryException(java.lang.String message)
Constructs anXQQueryExceptionobject with a given message.- Parameters:
message- the description of the error.nullindicates that the message string is non existant
-
XQQueryException
public XQQueryException(java.lang.String message, javax.xml.namespace.QName errorCode)Constructs anXQQueryExceptionobject with a given message, and error code.- Parameters:
message- the description of the error.nullindicates that the message string is non existanterrorCode-QNamewhich identifies the error according to the standard as described in Appendix F, XQuery 1.0: An XML Query language, Appendix C, XQuery 1.0 and XPath 2.0 Functions and Operators, and its associated specifications; implementation-defined errors may be raised.
-
-
XQQueryException
public XQQueryException(java.lang.String message, javax.xml.namespace.QName errorCode, int line, int column, int position)Constructs anXQQueryExceptionobject with a given message, error code, line number, column number, and position.- Parameters:
message- the description of the error.nullindicates that the message string is non existanterrorCode-QNamewhich identifies the error according to the standard as described in Appendix F, XQuery 1.0: An XML Query language, Appendix C, XQuery 1.0 and XPath 2.0 Functions and Operators, and its associated specifications; implementation-defined errors may be raised
line- the line number in the query string where the error occured. Line numbering starts at1.-1if unknowncolumn- the column number in the query string where the error occured. Column numbering starts at1.-1if unknownposition- the position in the query string where the error occured. This is a0based position.-1if unknown
-
-
XQQueryException
public XQQueryException(java.lang.String message, java.lang.String vendorCode, javax.xml.namespace.QName errorCode, int line, int column, int position)Constructs anXQQueryExceptionobject with a given message, vendor code, error code, line number, column number, and position.- Parameters:
message- the description of the error.nullindicates that the message string is non existantvendorCode- a vendor-specific string identifying the error.nullindicates there is no vendor code or it is unknownerrorCode-QNamewhich identifies the error according to the standard as described in Appendix F, XQuery 1.0: An XML Query language, Appendix C, XQuery 1.0 and XPath 2.0 Functions and Operators, and its associated specifications; implementation-defined errors may be raised
line- the line number in the query string where the error occured. Line numbering starts at1.-1if unknowncolumn- the column number in the query string where the error occured. Column numbering starts at1.-1if unknownposition- the position in the query string where the error occured. This is a0based position.-1if unknown
-
XQQueryException
public XQQueryException(java.lang.String message, java.lang.String vendorCode, javax.xml.namespace.QName errorCode, int line, int column, int position, java.lang.String moduleURI, XQSequence errorObject, XQStackTraceElement[] stackTrace)Constructs anXQQueryExceptionobject with a given message, vendor code, error code, line number, column number, position, module URI, error object, and stack trace.- Parameters:
message- the description of the error.nullindicates that the message string is non existantvendorCode- a vendor-specific string identifying the error.nullindicates there is no vendor code or it is unknownerrorCode-QNamewhich identifies the error according to the standard as described in Appendix F, XQuery 1.0: An XML Query language, Appendix C, XQuery 1.0 and XPath 2.0 Functions and Operators, and its associated specifications; implementation-defined errors may be raised
line- the line number in the query string where the error occured. Line numbering starts at1.-1if unknowncolumn- the column number in the query string where the error occured. Column numbering starts at1.-1if unknownposition- the position in the query string where the error occured. This is a0based position.-1if unknownmoduleURI- the module URI of the module in which the error occurred.nullwhen it is the main module or when the module is unknownerrorObject- anXQSequencerepresenting the error object passed tofn:error().nullif this error was not triggered byfn:error()or when the error object is not available.stackTrace- the XQuery stack trace where the error occurred.nullif not available
-
Method Detail
-
getErrorCode
public javax.xml.namespace.QName getErrorCode()
Gets the code identifying the error according to the standard as described in Appendix F, XQuery 1.0: An XML Query language, Appendix C, XQuery 1.0 and XPath 2.0 Functions and Operators, and its associated specifications; imlementation-defined errors may also be raised; finally the error code may also be specified in the query usingfn:error().- Returns:
- the code identifying the error, or
nullif not available
-
getErrorObject
public XQSequence getErrorObject()
Gets anXQSequencerepresenting the error object passed tofn:error(). Returnsnullif this error was not triggered byfn:error()or when the error object is not available.- Returns:
- the sequence passed to
fn:error(),nullif not available
-
getPosition
public int getPosition()
Gets the character position in the query string where this exception occurred. This is a0based position.-1if unknown.- Returns:
- the character position in the query string where the exception occurred
-
getQueryStackTrace
public XQStackTraceElement[] getQueryStackTrace()
Returns the query stack stackTrace when the exception occurred, or null if none. On some implementations only the top frame may be visible.- Returns:
- the stackTrace where the exception occurred
-
getModuleURI
public java.lang.String getModuleURI()
Gets the module URI of the module in which the error occurred.nullwhen it is the main module or when the module is unknown.- Returns:
- the module URI or
null
-
getLineNumber
public int getLineNumber()
Gets the line number in the query string where the error occurred. Line numbering starts at1.-1is returned if the line number is unknown. If the implementation does not support this method, it must return-1- Returns:
- the line number in the query string where the error occurred
-
getColumnNumber
public int getColumnNumber()
Gets the column number in the query string where the error occurred. Column numbering starts at1.-1is returned if the column number is unknown. If the implementation does not support this method, it must return-1- Returns:
- the column number in the query string where the error occurred
-