Qizx/open API

net.axyana.qizxopen.xquery
Class XQueryExpression

java.lang.Object
  extended bynet.axyana.qizxopen.xquery.XQueryEnvironment
      extended bynet.axyana.qizxopen.xquery.XQueryExpression
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
XQueryPreparedExpression

public class XQueryExpression
extends XQueryEnvironment

A XQuery Expression is intended for executing simple queries and can be reused.

Like in XQueryPreparedExpression, global variables can be bound to initial values, but without name control, since the query can change.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class net.axyana.qizxopen.xquery.XQueryEnvironment
DOC_BASE_URI, EXEC_TIMEOUT, MODULE_BASE_URI, SOURCE_URI, TRACE_EXECUTION, TRACE_QUERY_COMPIL
 
Method Summary
 XQResultSequence executeQuery(java.lang.String query)
          Compiles and executes an expression.
 void executeQuery(java.lang.String query, XMLEventReceiver result)
          Compiles and executes a expression, passes the result to a XML event handler, such as a XMLSerializer or a DOM builder.
 java.lang.String executeQuery(java.lang.String query, XMLSerialOptions serialOptions)
          Compiles and executes a expression, then serializes the results as a string.
 java.lang.String executeQuery(java.lang.String query, XSLTOptions xsltOptions)
          Compiles and executes a expression, then pass the result tree to a XSLT processor.
 XQueryConnection getConnection()
          Returns the related connection.
 NSPrefixMapping getInScopeNS()
          Gets the defined prefix/namespace mappings.
 XQType getType()
          Returns the type of the compiled expression, as evaluated by static analysis.
 java.lang.Object monitor(java.lang.String operation, java.lang.Object parameter)
          Asynchronous execution monitoring request.
 
Methods inherited from class net.axyana.qizxopen.xquery.XQueryEnvironment
authorizeClass, bind, bind, bindDouble, bindLong, bindObject, bindString, bindStringArray, defineGlobal, defineNamespace, getMessages, getSysProperty, registerCollation, setCollectionInput, setCurrentItem, setDefaultCollation, setDocumentInput, setDocumentInput, setFragmentInput, setImplicitTimezone, setInput, setInputDocument, setSysProperty
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getConnection

public XQueryConnection getConnection()
Description copied from class: XQueryEnvironment
Returns the related connection.

Specified by:
getConnection in class XQueryEnvironment

executeQuery

public XQResultSequence executeQuery(java.lang.String query)
                              throws XQueryException
Compiles and executes an expression.

Parameters:
query - the source code of a query to compile
Returns:
a Result Sequence which can be passed over a remote connection.
Throws:
XQueryException

executeQuery

public void executeQuery(java.lang.String query,
                         XMLEventReceiver result)
                  throws XQueryException,
                         DataModelException
Compiles and executes a expression, passes the result to a XML event handler, such as a XMLSerializer or a DOM builder.

The query must evaluate as a single Node, otherwise an EvalException is raised.

See executeQuery(String query) for more details

Parameters:
query - the source code of a query to compile
result - an object receiving XML data as a stream of events. Implementations include XMLSerializer and DOMBuilder.
Throws:
XQueryException
DataModelException

executeQuery

public java.lang.String executeQuery(java.lang.String query,
                                     XMLSerialOptions serialOptions)
                              throws XQueryException,
                                     DataModelException
Compiles and executes a expression, then serializes the results as a string. The query must evaluate as a single Node, otherwise an EvalException is raised.

See executeQuery(String query) for more details

Parameters:
query - the source code of a query to compile
serialOptions - a set of properties defining serialization options (see XMLSerializer for details).
Returns:
a string representing the serialized result of the query. Notice that an encoding specified in the options is only used for the XML header: the result is not encoded, since it is a Unicode string.
Throws:
XQueryException
DataModelException

executeQuery

public java.lang.String executeQuery(java.lang.String query,
                                     XSLTOptions xsltOptions)
                              throws XQueryException
Compiles and executes a expression, then pass the result tree to a XSLT processor. The output of the XSLT processor is serialized using xsl:output specifications in the XSLT stylesheet, then returned as a string. The query must evaluate as a single Node, otherwise an EvalException is raised.

See executeQuery(String query) for more details

Parameters:
query - the source code of a query to compile
xsltOptions - a set of properties defining XSLT options and parameters.
Returns:
a string representing the serialized result of the query. Notice that even though an encoding is specified in the options, the result is provided as a string of unencoded characters.
Throws:
XQueryException

monitor

public java.lang.Object monitor(java.lang.String operation,
                                java.lang.Object parameter)
                         throws XQueryException
Asynchronous execution monitoring request. This is the basis for a debugging facility to be enhanced.

Implemented operations:

Throws:
XQueryException

getInScopeNS

public NSPrefixMapping getInScopeNS()
                             throws XQueryException
Gets the defined prefix/namespace mappings.

Throws:
XQueryException

getType

public XQType getType()
               throws XQueryException
Returns the type of the compiled expression, as evaluated by static analysis.

Throws:
XQueryException

© 2005 Axyana Software