Qizx/open API

net.axyana.qizxopen.xquery
Class XQueryEnvironment

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

public abstract class XQueryEnvironment
extends java.lang.Object
implements java.io.Serializable

Client-side superclass for objects holding compilation and execution environments of XQueries (Connections and Expressions).

Used as a basis for XQueryConnection and XQueryExpression.

See Also:
Serialized Form

Field Summary
static java.lang.String DOC_BASE_URI
          System property: specifies a base URI for document resolution in the doc() function.
static java.lang.String EXEC_TIMEOUT
          System property: maximum allowed execution time.
static java.lang.String MODULE_BASE_URI
          System property: specifies a base URI for module resolution in "import module" and for XSLT stylesheets.
static java.lang.String SOURCE_URI
          System property: specifies the URI of the source code for diagnostics in prepareExpression.
static java.lang.String TRACE_EXECUTION
          System property: requests detailed execution trace (preliminary)
static java.lang.String TRACE_QUERY_COMPIL
          System property: requests query compilation trace (preliminary)
 
Method Summary
 void authorizeClass(java.lang.String className)
          Allows a Java class to be used as extension (more precisely, its public methods can be called as extension functions).
 void bind(QName varName, XQResultSequence value)
          Binds a sequence of Items with a global variable.
 void bind(QName varName, XQValue value)
          Binds a local Value (sequence of Items) with a global variable.
 void bindDouble(QName varName, double value)
          Binds a value with a global variable accepting the type xs:double.
 void bindLong(QName varName, long value)
          Binds a value with a global variable accepting the type xs:integer.
 void bindObject(QName varName, java.lang.Object value)
          Binds a value with a global variable accepting the type xdt:object.
 void bindString(QName varName, java.lang.String value)
          Binds a value with a global variable accepting the type xs:string.
 void bindStringArray(QName varName, java.lang.String[] value)
          Binds a value with a global variable accepting the type xs:string*.
 void defineGlobal(QName varName, XQType type)
          Defines a global variable in the predefined static context.
 void defineNamespace(java.lang.String prefix, java.lang.String uri)
          Defines a namespace mapping, visible by queries compiled with this environment.
abstract  XQueryConnection getConnection()
          Returns the related connection.
 XQMessage getMessages()
          Retrieves the list of messages generated by some methods (Expression execution and preparation).
 java.lang.Object getSysProperty(java.lang.String name)
          Retrieves a previously defined system property.
 void registerCollation(java.lang.String uri, java.text.Collator collator)
          Registers a custom collation for use in the processed queries.
 void setCollectionInput(java.lang.String collectionURI)
          Defines the input() sequence by a collection URI.
 void setCurrentItem(XQItem item)
          Sets the current item, which can be used for compilation or dynamic evaluation (x:eval() function).
 void setDefaultCollation(java.lang.String uri)
          Defines the URI of the default collation.
 void setDocumentInput(java.lang.String docURI)
          Specifies a document to be parsed and used as default root Node (also accessible through the XQuery function fn:input()), used when a Path expression has no explicit root.
 void setDocumentInput(XQNode root)
          Defines a default root Node (also accessible through the XQuery function fn:input()), used when a Path expression has no explicit root.
 void setFragmentInput(java.lang.String xmlFragment)
          Specifies a XML fragment to be parsed and used as default root Node (also accessible through the XQuery function fn:input()), used when a Path expression has no explicit root.
 void setImplicitTimezone(java.lang.String duration)
          Defines the implicit timezone in xs:duration format.
 void setInput(XQValue input)
          Defines a default root (also accessible through the XQuery function fn:input()), used when a Path expression has no explicit root.
 void setInputDocument(org.xml.sax.InputSource xmlSource)
          Defines a default root Node (also accessible through the XQuery function fn:input()), used when a Path expression has no explicit root.
 void setSysProperty(java.lang.String name, java.lang.Object property)
          Defines a property, a named object that can be retrieved by the extension function x:system-property(name) or by any application.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOURCE_URI

public static final java.lang.String SOURCE_URI
System property: specifies the URI of the source code for diagnostics in prepareExpression.

See Also:
Constant Field Values

DOC_BASE_URI

public static final java.lang.String DOC_BASE_URI
System property: specifies a base URI for document resolution in the doc() function. If defined, used in priority over the document base URI of the XQuery engine

See Also:
Constant Field Values

MODULE_BASE_URI

public static final java.lang.String MODULE_BASE_URI
System property: specifies a base URI for module resolution in "import module" and for XSLT stylesheets. If defined, used in priority over the module base URI of the XQuery engine

See Also:
Constant Field Values

TRACE_EXECUTION

public static final java.lang.String TRACE_EXECUTION
System property: requests detailed execution trace (preliminary)

See Also:
Constant Field Values

EXEC_TIMEOUT

public static final java.lang.String EXEC_TIMEOUT
System property: maximum allowed execution time. Reserved use.

See Also:
Constant Field Values

TRACE_QUERY_COMPIL

public static final java.lang.String TRACE_QUERY_COMPIL
System property: requests query compilation trace (preliminary)

See Also:
Constant Field Values
Method Detail

getConnection

public abstract XQueryConnection getConnection()
Returns the related connection.


authorizeClass

public void authorizeClass(java.lang.String className)
                    throws XQueryException
Allows a Java class to be used as extension (more precisely, its public methods can be called as extension functions).

Caution: This is a security feature. Using this method enforces an explicit control: After calling it, all Java classes to be used as extensions must be explicitly declared.
By default, any accessible class can be used.

Parameters:
className - fully qualified name of Java class, for example
java.io.File
Throws:
XQueryException

bind

public void bind(QName varName,
                 XQResultSequence value)
          throws XQueryException
Binds a sequence of Items with a global variable. The name is not checked, except in XQueryPreparedExpression.

Parameters:
varName - name of the variable.
value - value assigned to the variable.
Throws:
XQueryException

bind

public void bind(QName varName,
                 XQValue value)
          throws XQueryException
Binds a local Value (sequence of Items) with a global variable. The name is not checked, except in XQueryPreparedExpression.

Parameters:
varName - name of the variable.
value - value assigned to the variable.
Throws:
XQueryException

bindDouble

public void bindDouble(QName varName,
                       double value)
                throws XQueryException
Binds a value with a global variable accepting the type xs:double. The name is not checked, except in XQueryPreparedExpression.

Parameters:
varName - name of the variable.
value - double value assigned to the variable.
Throws:
XQueryException

bindLong

public void bindLong(QName varName,
                     long value)
              throws XQueryException
Binds a value with a global variable accepting the type xs:integer. The name is not checked, except in XQueryPreparedExpression.

Parameters:
varName - name of the variable.
value - integer value assigned to the variable.
Throws:
XQueryException

bindObject

public void bindObject(QName varName,
                       java.lang.Object value)
                throws XQueryException
Binds a value with a global variable accepting the type xdt:object. The name is not checked, except in XQueryPreparedExpression.

Parameters:
varName - name of the variable.
value - foreign object assigned to the variable.
Throws:
XQueryException

bindString

public void bindString(QName varName,
                       java.lang.String value)
                throws XQueryException
Binds a value with a global variable accepting the type xs:string. The name is not checked, except in XQueryPreparedExpression.

Parameters:
varName - name of the variable.
value - string value assigned to the variable.
Throws:
XQueryException

bindStringArray

public void bindStringArray(QName varName,
                            java.lang.String[] value)
                     throws XQueryException
Binds a value with a global variable accepting the type xs:string*. The name is not checked, except in XQueryPreparedExpression.

Parameters:
varName - name of the variable.
value - string sequence assigned to the variable.
Throws:
XQueryException

defineGlobal

public void defineGlobal(QName varName,
                         XQType type)
                  throws XQueryException
Defines a global variable in the predefined static context. The initial value must then be set by a variant of initGlobal() suitable to the type.

Parameters:
varName - name of the variable.
type - assigned to the variable.
Throws:
XQueryException

defineNamespace

public void defineNamespace(java.lang.String prefix,
                            java.lang.String uri)
                     throws XQueryException
Defines a namespace mapping, visible by queries compiled with this environment.

Throws:
XQueryException

getMessages

public XQMessage getMessages()
Retrieves the list of messages generated by some methods (Expression execution and preparation).


getSysProperty

public java.lang.Object getSysProperty(java.lang.String name)
                                throws XQueryException
Retrieves a previously defined system property.

Parameters:
name - of a property
Returns:
the stored property, or null if not found.
Throws:
XQueryException

registerCollation

public void registerCollation(java.lang.String uri,
                              java.text.Collator collator)
                       throws XQueryException
Registers a custom collation for use in the processed queries.

Throws:
XQueryException

setCollectionInput

public void setCollectionInput(java.lang.String collectionURI)
                        throws XQueryException
Defines the input() sequence by a collection URI.

Implemented only in XQuest.

Parameters:
collectionURI - URI of a collection, similar to the argument of fn:collection.
Throws:
XQueryException

setCurrentItem

public void setCurrentItem(XQItem item)
                    throws XQueryException
Sets the current item, which can be used for compilation or dynamic evaluation (x:eval() function).

Throws:
XQueryException

setDefaultCollation

public void setDefaultCollation(java.lang.String uri)
                         throws XQueryException
Defines the URI of the default collation.

Throws:
XQueryException

setDocumentInput

public void setDocumentInput(java.lang.String docURI)
                      throws XQueryException
Specifies a document to be parsed and used as default root Node (also accessible through the XQuery function fn:input()), used when a Path expression has no explicit root.

Parameters:
docURI - uri of a document to be opened or parsed and used as implicit input. This URI can be relative to the document base URI (if the default Document Manager is used).
Throws:
XQueryException

setDocumentInput

public void setDocumentInput(XQNode root)
                      throws XQueryException
Defines a default root Node (also accessible through the XQuery function fn:input()), used when a Path expression has no explicit root.

Throws:
XQueryException

setFragmentInput

public void setFragmentInput(java.lang.String xmlFragment)
                      throws XQueryException
Specifies a XML fragment to be parsed and used as default root Node (also accessible through the XQuery function fn:input()), used when a Path expression has no explicit root.

Parameters:
xmlFragment - a fragment of XML to be parsed and used as implicit input.
Throws:
XQueryException

setImplicitTimezone

public void setImplicitTimezone(java.lang.String duration)
                         throws XQueryException
Defines the implicit timezone in xs:duration format.

Parameters:
duration - for example "PT4H30M" or "-PT5H". If not specified, the implicit timezone is taken from the system default.
Throws:
XQueryException

setInput

public void setInput(XQValue input)
              throws XQueryException
Defines a default root (also accessible through the XQuery function fn:input()), used when a Path expression has no explicit root. It can be a single Node or a collection (Node sequence).

Throws:
XQueryException

setInputDocument

public void setInputDocument(org.xml.sax.InputSource xmlSource)
                      throws XQueryException
Defines a default root Node (also accessible through the XQuery function fn:input()), used when a Path expression has no explicit root.

Throws:
XQueryException

setSysProperty

public void setSysProperty(java.lang.String name,
                           java.lang.Object property)
                    throws XQueryException
Defines a property, a named object that can be retrieved by the extension function x:system-property(name) or by any application.

Parameters:
name - of a property
property - value of the property to store.
Throws:
XQueryException

© 2005 Axyana Software