|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.xqj.Closable net.sf.saxon.xqj.SaxonXQDynamicContext net.sf.saxon.xqj.SaxonXQPreparedExpression
public class SaxonXQPreparedExpression
Saxon implementation of the XQJ interface XQPreparedExpression. This represents a compiled XQuery expression, together with the dynamic context for its evaluation. Note that this means the object should not be used in more than one thread concurrently.
Note that an expression is scrollable or not depending on the scrollability property of the XQConnection that was used to compile this expression (at the time it was compiled). If the expression is scrollable then its results are delivered in an XQSequence that supports scrolling backwards as well as forwards.
For full Javadoc details, see the XQJ interface specification.
Field Summary |
---|
Fields inherited from class net.sf.saxon.xqj.SaxonXQDynamicContext |
---|
connection |
Constructor Summary | |
---|---|
protected |
SaxonXQPreparedExpression(SaxonXQConnection connection,
XQueryExpression expression,
SaxonXQStaticContext sqc,
DynamicQueryContext context)
|
Method Summary | |
---|---|
void |
cancel()
Attempts to cancel the execution if both the XQuery engine and XQJ driver support aborting the execution of an XQPreparedExpression . |
javax.xml.xquery.XQResultSequence |
executeQuery()
Executes the prepared query expression. |
protected boolean |
externalVariableExists(QName name)
|
QName[] |
getAllExternalVariables()
Retrieves all the external variables defined in the prolog of the prepared expression. |
QName[] |
getAllUnboundExternalVariables()
Retrieves the names of all unbound external variables. |
protected SaxonXQConnection |
getConnection()
|
protected SaxonXQDataFactory |
getDataFactory()
|
protected DynamicQueryContext |
getDynamicContext()
|
protected SaxonXQStaticContext |
getSaxonXQStaticContext()
|
javax.xml.xquery.XQStaticContext |
getStaticContext()
Gets an XQStaticContext representing the values for all
expression properties. |
javax.xml.xquery.XQSequenceType |
getStaticResultType()
Gets the static type information of the result sequence. |
javax.xml.xquery.XQSequenceType |
getStaticVariableType(QName name)
Retrieves the static type of a given external variable. |
protected XQueryExpression |
getXQueryExpression()
|
Methods inherited from class net.sf.saxon.xqj.SaxonXQDynamicContext |
---|
bindAtomicValue, bindBoolean, bindByte, bindDocument, bindDocument, bindDocument, bindDocument, bindDocument, bindDouble, bindFloat, bindInt, bindItem, bindLong, bindNode, bindObject, bindSequence, bindShort, bindString, getConfiguration, getImplicitTimeZone, setImplicitTimeZone |
Methods inherited from class net.sf.saxon.xqj.Closable |
---|
close, isClosed, setClosableContainer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface javax.xml.xquery.XQPreparedExpression |
---|
close, isClosed |
Methods inherited from interface javax.xml.xquery.XQDynamicContext |
---|
bindAtomicValue, bindBoolean, bindByte, bindDocument, bindDocument, bindDocument, bindDocument, bindDocument, bindDouble, bindFloat, bindInt, bindItem, bindLong, bindNode, bindObject, bindSequence, bindShort, bindString, getImplicitTimeZone, setImplicitTimeZone |
Constructor Detail |
---|
protected SaxonXQPreparedExpression(SaxonXQConnection connection, XQueryExpression expression, SaxonXQStaticContext sqc, DynamicQueryContext context) throws javax.xml.xquery.XQException
javax.xml.xquery.XQException
Method Detail |
---|
protected DynamicQueryContext getDynamicContext()
getDynamicContext
in class SaxonXQDynamicContext
protected SaxonXQConnection getConnection()
protected SaxonXQDataFactory getDataFactory() throws javax.xml.xquery.XQException
getDataFactory
in class SaxonXQDynamicContext
javax.xml.xquery.XQException
protected XQueryExpression getXQueryExpression()
protected SaxonXQStaticContext getSaxonXQStaticContext()
public void cancel() throws javax.xml.xquery.XQException
javax.xml.xquery.XQPreparedExpression
XQPreparedExpression
.
This method can be used by one thread to cancel an XQPreparedExpression
,
that is being executed in another thread. If cancellation is not supported or
the attempt to cancel the execution was not successful, the method returns without
any error. If the cancellation is successful, an XQException
is thrown, to indicate that it has been aborted, by executeQuery
,
executeCommand
or any method accessing the XQResultSequence
returned by executeQuery
. If applicable, any open XQResultSequence
and XQResultItem
objects will also be implicitly closed in this case.
cancel
in interface javax.xml.xquery.XQPreparedExpression
javax.xml.xquery.XQException
- if the prepared expression is in a closed statepublic javax.xml.xquery.XQResultSequence executeQuery() throws javax.xml.xquery.XQException
javax.xml.xquery.XQPreparedExpression
executeQuery
in interface javax.xml.xquery.XQPreparedExpression
javax.xml.xquery.XQException
- if (1) there are errors when executing the prepared
expression, (2) the prepared expression is in a closed state,
or (3) the query execution is cancelledpublic QName[] getAllExternalVariables() throws javax.xml.xquery.XQException
javax.xml.xquery.XQPreparedExpression
getAllExternalVariables
in interface javax.xml.xquery.XQPreparedExpression
QName
objects for all the external
variables defined in the prolog of a prepared expression.
Empty array if there are no external variables present.
javax.xml.xquery.XQException
- if the prepared expression is in a closed statepublic QName[] getAllUnboundExternalVariables() throws javax.xml.xquery.XQException
javax.xml.xquery.XQPreparedExpression
getAllUnboundExternalVariables
in interface javax.xml.xquery.XQPreparedExpression
QName
for all the external variables defined
in the prolog of a prepared expression that are yet to be bound
with a value. If there are no such variables an empty array
is returned
javax.xml.xquery.XQException
- if the prepared expression is in a closed statepublic javax.xml.xquery.XQStaticContext getStaticContext() throws javax.xml.xquery.XQException
javax.xml.xquery.XQPreparedExpression
XQStaticContext
representing the values for all
expression properties. Note that these properties cannot be changed; in
order to change, a new XQPreparedExpression
needs to be created.
getStaticContext
in interface javax.xml.xquery.XQPreparedExpression
XQStaticContext
representing
the values for all expression properties
javax.xml.xquery.XQException
- if the expression is in a closed statepublic javax.xml.xquery.XQSequenceType getStaticResultType() throws javax.xml.xquery.XQException
javax.xml.xquery.XQPreparedExpression
XQSequenceType
object
corresponding to the XQuery sequence type item()*
.
getStaticResultType
in interface javax.xml.xquery.XQPreparedExpression
XQSequenceType
containing the static
result information.
javax.xml.xquery.XQException
- if the prepared expression is in a closed statepublic javax.xml.xquery.XQSequenceType getStaticVariableType(QName name) throws javax.xml.xquery.XQException
javax.xml.xquery.XQPreparedExpression
getStaticVariableType
in interface javax.xml.xquery.XQPreparedExpression
name
- the name of the external variable
javax.xml.xquery.XQException
- if (1) the variable does not exist in the static
context of the expression, or (2) the sequence is
in a closed state, or (3) the name
parameter is null
protected boolean externalVariableExists(QName name)
externalVariableExists
in class SaxonXQDynamicContext
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |