Public Member Functions | Protected Member Functions | List of all members
org.zorbaxquery.api.xqj.ZorbaXQStaticContext Class Reference

An ZorbaXQStaticContext represents default values for various XQuery Static Context Components. More...

Public Member Functions

void declareNamespace (String prefix, String URI) throws XQException
 Declares a namespace prefix and associates it with a namespace URI.
String getBaseURI ()
 Gets the Base URI, if set in the static context, else the empty string.
int getBindingMode ()
 Gets the value of the binding mode property.
int getBoundarySpacePolicy ()
 Gets the boundary-space policy defined in the static context.
int getConstructionMode ()
 Gets the construction mode defined in the static context.
XQItemType getContextItemStaticType ()
 Gets the static type of the context item.
int getCopyNamespacesModeInherit ()
 Gets the inherit part of the copy-namespaces mode defined in the static context.
int getCopyNamespacesModePreserve ()
 Gets the preserve part of the copy-namespaces mode defined in the static context.
String getDefaultCollation ()
 Gets the URI of the default collation.
String getDefaultElementTypeNamespace ()
 Gets the URI of the default element/type namespace, the empty string if not set.
String getDefaultFunctionNamespace ()
 Gets the URI of the default function namespace, the empty string if not set.
int getDefaultOrderForEmptySequences ()
 Gets the default order for empty sequences defined in the static context.
int getHoldability ()
 Gets the value of the holdability property.
String[] getNamespacePrefixes ()
 Returns the prefixes of all the statically known namespaces.
String getNamespaceURI (String prefix) throws XQException
 Retrieves the namespace URI associated with a prefix.
int getOrderingMode ()
 Gets the ordering mode defined in the static context.
int getQueryLanguageTypeAndVersion ()
 Gets the value of the language type and version property.
int getQueryTimeout ()
 Retrieves the number of seconds an implementation will wait for a query to execute.
int getScrollability ()
 Gets the value of the scrollability property.
ZorbaXQStaticCollectionManager getStaticCollectionManager () throws XQException
 Returns a StaticCollectionManager.
void setBaseURI (String URI) throws XQException
 Sets the Base URI in the static context, specify the empty string to make it undefined.
void setBindingMode (int i) throws XQException
 Sets the binding mode property.
void setBoundarySpacePolicy (int i) throws XQException
 Sets the boundary-space policy in the static context.
void setConstructionMode (int i) throws XQException
 Sets the construction mode in the static context.
void setContextItemStaticType (XQItemType xqit) throws XQException
 Sets the static type of the context item, specify null to make it unspecified.
void setCopyNamespacesModeInherit (int i) throws XQException
 Sets the inherit part of the copy-namespaces mode in the static context.
void setCopyNamespacesModePreserve (int i) throws XQException
 Sets the preserve part of the copy-namespaces mode in the static context.
void setDefaultCollation (String URI) throws XQException
 Sets the URI of the default collation.
void setDefaultElementTypeNamespace (String URI) throws XQException
 Sets the URI of the default element/type namespace, the empty string to make it unspecified.
void setDefaultFunctionNamespace (String URI) throws XQException
 Sets the URI of the default function namespace, the empty string to make it unspecified.
void setDefaultOrderForEmptySequences (int i) throws XQException
 Sets the default order for empty sequences in the static context.
void setHoldability (int i) throws XQException
 Sets the holdability property.
void setOrderingMode (int i) throws XQException
 Sets the ordering mode in the static context.
void setQueryLanguageTypeAndVersion (int i) throws XQException
 Sets the input query language type and version.
void setQueryTimeout (int i) throws XQException
 Sets the number of seconds an implementation will wait for a query to execute.
void setScrollability (int i) throws XQException
 Sets the scrollability of the result sequence.
 ZorbaXQStaticContext (Zorba aZorba)
 ZorbaXQStaticContext (XQuery aQuery)

Protected Member Functions

StaticContext getZorbaStaticContext ()
void setLIBPaths (StringVector aLIBPath)
void setMODPaths (StringVector aMODPath)
void setURIPaths (StringVector aURIPath)

Detailed Description

An ZorbaXQStaticContext represents default values for various XQuery Static Context Components.

Further it includes the static XQJ properties for an XQExpression or XQPreparedExpression object.

The following XQuery Static Context Components are supported through the ZorbaXQStaticContext interface:

As described in the XQuery specification, each of these default values can be overridden or augmented in the query prolog. In addition ZorbaXQStaticContext includes the static XQJ properties for an XQExpression or XQPreparedExpression object:

Note that ZorbaXQStaticContext is a value object, changing attributes in such object doesn't affect any existing XQExpression or XQPreparedExpression object. In order to take effect, the application needs to explicitly change the XQConnection default values, or specify an ZorbaXQStaticContext object when creating an XQExpression or XQPreparedExpression.

XQConnection conn = XQDatasource.getConnection();
// get the default values from the implementation
ZorbaXQStaticContext cntxt = conn.getStaticContext();
// change the base uri
cntxt.setBaseURI("http://www.foo.com/xml/");
// change the implementation defaults
conn.setStaticContext(cntxt);
// create an XQExpression using the new defaults
XQExpression expr1 = conn.createExpression();
// creat an XQExpression, using BaseURI "file:///root/user/john/"
cntxt.setBaseURI("file:///root/user/john/");
XQExpression expr2 = conn.createExpression(cntxt);
...

Definition at line 80 of file ZorbaXQStaticContext.java.

Constructor & Destructor Documentation

org.zorbaxquery.api.xqj.ZorbaXQStaticContext.ZorbaXQStaticContext ( Zorba  aZorba)
inline

Definition at line 103 of file ZorbaXQStaticContext.java.

org.zorbaxquery.api.xqj.ZorbaXQStaticContext.ZorbaXQStaticContext ( XQuery  aQuery)
inline

Definition at line 110 of file ZorbaXQStaticContext.java.

Member Function Documentation

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.declareNamespace ( String  prefix,
String  URI 
) throws XQException
inline

Declares a namespace prefix and associates it with a namespace URI.

If the namespace URI is the empty string, the prefix is removed from the in-scope namespace definitions.

Parameters
prefix- the prefix for the namespace URI
URI- the namespace URI. An empty string undeclares the specific prefix. Cannot be null
Exceptions
XQException- if (1) a null prefix, or (2) a null namespace URI is specified

Definition at line 182 of file ZorbaXQStaticContext.java.

String org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getBaseURI ( )
inline

Gets the Base URI, if set in the static context, else the empty string.

Returns
the base URI, if set, else the empty string. Cannot be null..

Definition at line 498 of file ZorbaXQStaticContext.java.

int org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getBindingMode ( )
inline

Gets the value of the binding mode property.

By default an XQJ implementation operates in immediate binding mode.

Returns
the binding mode. One of XQConstants.BINDING_MODE_IMMEDIATE, orXQConstants.BINDING_MODE_DEFERRED.

Definition at line 524 of file ZorbaXQStaticContext.java.

int org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getBoundarySpacePolicy ( )
inline

Gets the boundary-space policy defined in the static context.

Returns
the boundary-space policy value. One of: XQConstants.BOUNDARY_SPACE_PRESERVE, XQConstants.BOUNDARY_SPACE_STRIP.

Definition at line 403 of file ZorbaXQStaticContext.java.

int org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getConstructionMode ( )
inline

Gets the construction mode defined in the static context.

Returns
construction mode value. One of: XQConstants.CONSTRUCTION_MODE_PRESERVE, XQConstants.CONSTRUCTION_MODE_STRIP

Definition at line 310 of file ZorbaXQStaticContext.java.

XQItemType org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getContextItemStaticType ( )
inline

Gets the static type of the context item.

null if unspecified.

Returns
the static type of the context item, if set, else null

Definition at line 265 of file ZorbaXQStaticContext.java.

int org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getCopyNamespacesModeInherit ( )
inline

Gets the inherit part of the copy-namespaces mode defined in the static context.

Returns
construction mode value. One of: XQConstants.COPY_NAMESPACES_MODE_INHERIT, XQConstants.COPY_NAMESPACES_MODE_NO_INHERIT.

Definition at line 466 of file ZorbaXQStaticContext.java.

int org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getCopyNamespacesModePreserve ( )
inline

Gets the preserve part of the copy-namespaces mode defined in the static context.

Returns
construction mode value. One of: XQConstants.COPY_NAMESPACES_MODE_PRESERVE, XQConstants.COPY_NAMESPACES_MODE_NO_PRESERVE.

Definition at line 434 of file ZorbaXQStaticContext.java.

String org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getDefaultCollation ( )
inline

Gets the URI of the default collation.

Returns
the URI of the default collation. Cannot be null.

Definition at line 290 of file ZorbaXQStaticContext.java.

String org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getDefaultElementTypeNamespace ( )
inline

Gets the URI of the default element/type namespace, the empty string if not set.

Returns
the URI of the default element/type namespace, if set, else the empty string. Cannot be null

Definition at line 225 of file ZorbaXQStaticContext.java.

String org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getDefaultFunctionNamespace ( )
inline

Gets the URI of the default function namespace, the empty string if not set.

Returns
the URI of the default function namespace, if set, else the empty string. Cannot be null

Definition at line 245 of file ZorbaXQStaticContext.java.

int org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getDefaultOrderForEmptySequences ( )
inline

Gets the default order for empty sequences defined in the static context.

Returns
default order for empty sequences value. One of: XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_GREATEST, XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_LEAST.

Definition at line 372 of file ZorbaXQStaticContext.java.

int org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getHoldability ( )
inline

Gets the value of the holdability property.

Returns
the type of a result's holdability. One of: XQConstants.HOLDTYPE_HOLD_CURSORS_OVER_COMMIT, or XQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT.

Definition at line 547 of file ZorbaXQStaticContext.java.

String [] org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getNamespacePrefixes ( )
inline

Returns the prefixes of all the statically known namespaces.

Use the getNamespaceURI method to look up the namespace URI corresponding to a specific prefix.

Returns
String array containing the namespace prefixes. Cannot be null

Definition at line 143 of file ZorbaXQStaticContext.java.

String org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getNamespaceURI ( String  prefix) throws XQException
inline

Retrieves the namespace URI associated with a prefix.

An XQException is thrown if an unknown prefix is specified, i.e. a prefix not returned by the getInScopeNamespacePrefixes method.

Parameters
prefix- the prefix for which the namespace URI is sought. Cannot be null
Returns
the namespace URI. Cannot be null
Exceptions
XQException- if a null prefix is specified or if the prefix is unknown

Definition at line 163 of file ZorbaXQStaticContext.java.

int org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getOrderingMode ( )
inline

Gets the ordering mode defined in the static context.

Returns
ordering mode value. One of: XQConstants.ORDERING_MODE_ORDERED, XQConstants.ORDERING_MODE_UNORDERED.

Definition at line 341 of file ZorbaXQStaticContext.java.

int org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getQueryLanguageTypeAndVersion ( )
inline

Gets the value of the language type and version property.

By default an XQJ implementation's default is XQConstants.LANGTYPE_XQUERY.

Returns
the language type and version. One of: XQConstants.LANGTYPE_XQUERY, or XQConstants.LANGTYPE_XQUERYX or a negative value indicating a vendor specific query language type and version.

Definition at line 570 of file ZorbaXQStaticContext.java.

int org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getQueryTimeout ( )
inline

Retrieves the number of seconds an implementation will wait for a query to execute.

Returns
the query execution timeout value in seconds. A value of 0 indicates no limit.

Definition at line 617 of file ZorbaXQStaticContext.java.

int org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getScrollability ( )
inline

Gets the value of the scrollability property.

By default query results are forward only.

Returns
the type of a result's scrollability. One of: XQConstants.SCROLLTYPE_FORWARD_ONLY, or XQConstants.SCROLLTYPE_SCROLLABLE.

Definition at line 594 of file ZorbaXQStaticContext.java.

ZorbaXQStaticCollectionManager org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getStaticCollectionManager ( ) throws XQException
inline

Returns a StaticCollectionManager.

Returns a CollectionManager responsible for all collections which are statically declared in the static context of this query (main module) or any transitively imported library module. The collection manager provides a set of functions for managing collections and their contents.

Returns
ZorbaXQStaticCollectionManager The collection manager responsible for managing collections of this Sequence.
Exceptions
XQException- if the object is closed

Definition at line 642 of file ZorbaXQStaticContext.java.

StaticContext org.zorbaxquery.api.xqj.ZorbaXQStaticContext.getZorbaStaticContext ( )
inlineprotected

Definition at line 99 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setBaseURI ( String  URI) throws XQException
inline

Sets the Base URI in the static context, specify the empty string to make it undefined.

Parameters
URI- the new baseUri, or empty string to make it undefined. Cannot be null.
Exceptions
XQException- if a null base uri is specified

Definition at line 512 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setBindingMode ( int  i) throws XQException
inline

Sets the binding mode property.

By default an XQJ implementation operates in immediate binding mode.

Parameters
i- the binding mode. One of: XQConstants.BINDING_MODE_IMMEDIATE, orXQConstants.BINDING_MODE_DEFERRED.
Exceptions
XQException- the specified mode is different from XQConstants.BINDING_MODE_IMMEDIATE, XQConstants.BINDING_MODE_DEFERRED

Definition at line 535 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setBoundarySpacePolicy ( int  i) throws XQException
inline

Sets the boundary-space policy in the static context.

Parameters
i- boundary space policy. One of: XQConstants.BOUNDARY_SPACE_PRESERVE, XQConstants.BOUNDARY_SPACE_STRIP.
Exceptions
XQException- the specified mode is different from XQConstants.BOUNDARY_SPACE_PRESERVE, XQConstants.BOUNDARY_SPACE_STRIP

Definition at line 418 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setConstructionMode ( int  i) throws XQException
inline

Sets the construction mode in the static context.

Parameters
i- construction mode value. One of: XQConstants.CONSTRUCTION_MODE_PRESERVE, XQConstants.CONSTRUCTION_MODE_STRIP.
Exceptions
XQException- the specified mode is different from XQConstants.CONSTRUCTION_MODE_PRESERVE, XQConstants.CONSTRUCTION_MODE_STRIP

Definition at line 325 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setContextItemStaticType ( XQItemType  xqit) throws XQException
inline

Sets the static type of the context item, specify null to make it unspecified.

Parameters
xqit- the static type of the context item; null if unspecified.
Exceptions
XQException- if the contextItemType is not a valid ZorbaXQItemType

Definition at line 277 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setCopyNamespacesModeInherit ( int  i) throws XQException
inline

Sets the inherit part of the copy-namespaces mode in the static context.

Parameters
i- ordering mode value. One of: XQConstants.COPY_NAMESPACES_MODE_INHERIT, XQConstants.COPY_NAMESPACES_MODE_NO_INHERIT.
Exceptions
XQException- the specified mode is different from XQConstants.COPY_NAMESPACES_MODE_INHERIT, XQConstants.COPY_NAMESPACES_MODE_NO_INHERIT

Definition at line 481 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setCopyNamespacesModePreserve ( int  i) throws XQException
inline

Sets the preserve part of the copy-namespaces mode in the static context.

Parameters
i- ordering mode value. One of: XQConstants.COPY_NAMESPACES_MODE_PRESERVE, XQConstants.COPY_NAMESPACES_MODE_NO_PRESERVE.
Exceptions
XQException- the specified mode is different from XQConstants.COPY_NAMESPACES_MODE_PRESERVE, XQConstants.COPY_NAMESPACES_MODE_NO_PRESERVE

Definition at line 449 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setDefaultCollation ( String  URI) throws XQException
inline

Sets the URI of the default collation.

Parameters
URI- the namespace URI of the default collation. Cannot be null.
Exceptions
XQException- if a null URI is specified

Definition at line 300 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setDefaultElementTypeNamespace ( String  URI) throws XQException
inline

Sets the URI of the default element/type namespace, the empty string to make it unspecified.

Parameters
URI- the namespace URI of the default element/type namespace, the empty string to make it unspecified. Cannot be null.
Exceptions
XQException- if a null uri is specified

Definition at line 235 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setDefaultFunctionNamespace ( String  URI) throws XQException
inline

Sets the URI of the default function namespace, the empty string to make it unspecified.

Parameters
URI- the namespace URI of the default function namespace, the empty string to make it unspecified. Cannot be null.
Exceptions
XQException- if a null URI is specified

Definition at line 255 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setDefaultOrderForEmptySequences ( int  i) throws XQException
inline

Sets the default order for empty sequences in the static context.

Parameters
i- the default order for empty sequences. One of: XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_GREATEST, XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_LEAST.
Exceptions
XQException- the specified order for empty sequences is different from XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_GREATEST, XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_LEAST

Definition at line 387 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setHoldability ( int  i) throws XQException
inline

Sets the holdability property.

Parameters
i- the holdability of the result. One of: XQConstants.HOLDTYPE_HOLD_CURSORS_OVER_COMMIT, or XQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT.
Exceptions
XQException- the specified holdability is different from XQConstants.HOLDTYPE_HOLD_CURSORS_OVER_COMMIT, XQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT

Definition at line 557 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setLIBPaths ( StringVector  aLIBPath)
inlineprotected

Definition at line 124 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setMODPaths ( StringVector  aMODPath)
inlineprotected

Definition at line 130 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setOrderingMode ( int  i) throws XQException
inline

Sets the ordering mode in the static context.

Parameters
i- ordering mode value. One of: XQConstants.ORDERING_MODE_ORDERED, XQConstants.ORDERING_MODE_UNORDERED.
Exceptions
XQException- the specified mode is different from XQConstants.ORDERING_MODE_ORDERED, XQConstants.ORDERING_MODE_UNORDERED

Definition at line 356 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setQueryLanguageTypeAndVersion ( int  i) throws XQException
inline

Sets the input query language type and version.

When this is set to a particular language type and version, then the query is assumed to be in that language and version.

Parameters
i- the query language type and version of the inputs. One of: XQConstants.LANGTYPE_XQUERY (default), or XQConstants.LANGTYPE_XQUERYX. A negative number indicates a vendor specific query language type and version.
Exceptions
XQException- the specified langtype is different from XQConstants.LANGTYPE_XQUERY, XQConstants.LANGTYPE_XQUERYX and is not negative

Definition at line 581 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setQueryTimeout ( int  i) throws XQException
inline

Sets the number of seconds an implementation will wait for a query to execute.

If the implementation does not support query timeout it can ignore the specified timeout value. It the limit is exceeded, the behavor of the query is the same as an execution of a cancel by another thread.

Parameters
i- the query execution timeout value in seconds. A value of 0 indicates no limit
Exceptions
XQException- if the passed in value is negative

Definition at line 628 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setScrollability ( int  i) throws XQException
inline

Sets the scrollability of the result sequence.

By default query results are forward only.

Parameters
i- the scrollability of the result. One of: XQConstants.SCROLLTYPE_FORWARD_ONLY, or XQConstants.SCROLLTYPE_SCROLLABLE.
Exceptions
XQException- the specified crollability type is different from XQConstants.SCROLLTYPE_FORWARD_ONLY, XQConstants.SCROLLTYPE_SCROLLABLE

Definition at line 605 of file ZorbaXQStaticContext.java.

void org.zorbaxquery.api.xqj.ZorbaXQStaticContext.setURIPaths ( StringVector  aURIPath)
inlineprotected

Definition at line 118 of file ZorbaXQStaticContext.java.


The documentation for this class was generated from the following file:
blog comments powered by Disqus