io::zorba::api::xqj::ZorbaXQStaticContextAn 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:
{.java} 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); ... Private Attributes
package-attrib
Protected Functions
Public Functions
Private Functions
Private Attributesbindingint binding
holdabilityint holdability
libPathsStringVector libPaths
modulePathsStringVector modulePaths
queryXQuery query
queryLangint queryLang
scrollabilityint scrollability
staticContextStaticContext staticContext
uriPathsStringVector uriPaths
zorbaZorba zorba
package-attribbaseURIString baseURI
contextItemStaticTypeXQItemType contextItemStaticType
namespacesMap< String, String > namespaces
Protected FunctionsgetZorbaStaticContextStaticContext getZorbaStaticContext()
setLIBPathsvoid setLIBPaths(StringVector aLIBPath)
setMODPathsvoid setMODPaths(StringVector aMODPath)
setURIPathsvoid setURIPaths(StringVector aURIPath)
Public FunctionsdeclareNamespacevoid declareNamespace(String prefix, String URI) 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
Parameters
getBaseURIString getBaseURI() Gets the Base URI, if set in the static context, else the empty string.
Returnsthe base URI, if set, else the empty string. Cannot be null..getBindingModeint getBindingMode() Gets the value of the binding mode property. By default an XQJ implementation operates in immediate binding mode. Returnsthe binding mode. One of XQConstants.BINDING_MODE_IMMEDIATE, orXQConstants.BINDING_MODE_DEFERRED.getBoundarySpacePolicyint getBoundarySpacePolicy() Gets the boundary-space policy defined in the static context.
Returnsthe boundary-space policy value. One of: XQConstants.BOUNDARY_SPACE_PRESERVE, XQConstants.BOUNDARY_SPACE_STRIP.getConstructionModeint getConstructionMode() Gets the construction mode defined in the static context.
Returnsconstruction mode value. One of: XQConstants.CONSTRUCTION_MODE_PRESERVE, XQConstants.CONSTRUCTION_MODE_STRIPgetContextItemStaticTypeXQItemType getContextItemStaticType() Gets the static type of the context item. null if unspecified. Returnsthe static type of the context item, if set, else nullgetCopyNamespacesModeInheritint getCopyNamespacesModeInherit() Gets the inherit part of the copy-namespaces mode defined in the static context.
Returnsconstruction mode value. One of: XQConstants.COPY_NAMESPACES_MODE_INHERIT, XQConstants.COPY_NAMESPACES_MODE_NO_INHERIT.getCopyNamespacesModePreserveint getCopyNamespacesModePreserve() Gets the preserve part of the copy-namespaces mode defined in the static context.
Returnsconstruction mode value. One of: XQConstants.COPY_NAMESPACES_MODE_PRESERVE, XQConstants.COPY_NAMESPACES_MODE_NO_PRESERVE.getDefaultCollationString getDefaultCollation() Gets the URI of the default collation.
Returnsthe URI of the default collation. Cannot be null.getDefaultElementTypeNamespaceString getDefaultElementTypeNamespace() Gets the URI of the default element/type namespace, the empty string if not set.
Returnsthe URI of the default element/type namespace, if set, else the empty string. Cannot be nullgetDefaultFunctionNamespaceString getDefaultFunctionNamespace() Gets the URI of the default function namespace, the empty string if not set.
Returnsthe URI of the default function namespace, if set, else the empty string. Cannot be nullgetDefaultOrderForEmptySequencesint getDefaultOrderForEmptySequences() Gets the default order for empty sequences defined in the static context.
Returnsdefault order for empty sequences value. One of: XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_GREATEST, XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_LEAST.getHoldabilityint getHoldability() Gets the value of the holdability property.
Returnsthe type of a result's holdability. One of: XQConstants.HOLDTYPE_HOLD_CURSORS_OVER_COMMIT, or XQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT.getNamespacePrefixesString[] getNamespacePrefixes() Returns the prefixes of all the statically known namespaces. Use the getNamespaceURI method to look up the namespace URI corresponding to a specific prefix. ReturnsString array containing the namespace prefixes. Cannot be nullgetNamespaceURIString getNamespaceURI(String prefix) 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
Returnsthe namespace URI. Cannot be nullParameters
getOrderingModeint getOrderingMode() Gets the ordering mode defined in the static context.
Returnsordering mode value. One of: XQConstants.ORDERING_MODE_ORDERED, XQConstants.ORDERING_MODE_UNORDERED.getQueryLanguageTypeAndVersionint getQueryLanguageTypeAndVersion() Gets the value of the language type and version property. By default an XQJ implementation's default is XQConstants.LANGTYPE_XQUERY. Returnsthe 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.getQueryTimeoutint getQueryTimeout() Retrieves the number of seconds an implementation will wait for a query to execute.
Returnsthe query execution timeout value in seconds. A value of 0 indicates no limit.getScrollabilityint getScrollability() Gets the value of the scrollability property. By default query results are forward only. Returnsthe type of a result's scrollability. One of: XQConstants.SCROLLTYPE_FORWARD_ONLY, or XQConstants.SCROLLTYPE_SCROLLABLE.getStaticCollectionManagerZorbaXQStaticCollectionManager getStaticCollectionManager() 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. ReturnsZorbaXQStaticCollectionManager The collection manager responsible for managing collections of this Sequence.Parameters
setBaseURIvoid setBaseURI(String URI) Sets the Base URI in the static context, specify the empty string to make it undefined.
Parameters
Parameters
setBindingModevoid setBindingMode(int i) Sets the binding mode property. By default an XQJ implementation operates in immediate binding mode. Parameters
Parameters
setBoundarySpacePolicyvoid setBoundarySpacePolicy(int i) Sets the boundary-space policy in the static context.
Parameters
Parameters
setConstructionModevoid setConstructionMode(int i) Sets the construction mode in the static context.
Parameters
Parameters
setContextItemStaticTypevoid setContextItemStaticType(XQItemType xqit) Sets the static type of the context item, specify null to make it unspecified.
Parameters
Parameters
setCopyNamespacesModeInheritvoid setCopyNamespacesModeInherit(int i) Sets the inherit part of the copy-namespaces mode in the static context.
Parameters
Parameters
setCopyNamespacesModePreservevoid setCopyNamespacesModePreserve(int i) Sets the preserve part of the copy-namespaces mode in the static context.
Parameters
Parameters
setDefaultCollationvoid setDefaultCollation(String URI) Sets the URI of the default collation.
Parameters
Parameters
setDefaultElementTypeNamespacevoid setDefaultElementTypeNamespace(String URI) Sets the URI of the default element/type namespace, the empty string to make it unspecified.
Parameters
Parameters
setDefaultFunctionNamespacevoid setDefaultFunctionNamespace(String URI) Sets the URI of the default function namespace, the empty string to make it unspecified.
Parameters
Parameters
setDefaultOrderForEmptySequencesvoid setDefaultOrderForEmptySequences(int i) Sets the default order for empty sequences in the static context.
Parameters
Parameters
setHoldabilityvoid setHoldability(int i) Sets the holdability property.
Parameters
Parameters
setOrderingModevoid setOrderingMode(int i) Sets the ordering mode in the static context.
Parameters
Parameters
setQueryLanguageTypeAndVersionvoid setQueryLanguageTypeAndVersion(int i) 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
Parameters
setQueryTimeoutvoid setQueryTimeout(int i) 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
Parameters
setScrollabilityvoid setScrollability(int i) Sets the scrollability of the result sequence. By default query results are forward only. Parameters
Parameters
ZorbaXQStaticContext ZorbaXQStaticContext(Zorba aZorba)
ZorbaXQStaticContext ZorbaXQStaticContext(XQuery aQuery)
Private FunctionsisNullXQExceptionvoid isNullXQException(Object value)
|