Package com.saxonica.xqj
Class SaxonXQStaticContext
java.lang.Object
com.saxonica.xqj.SaxonXQStaticContext
- All Implemented Interfaces:
XQStaticContext
Saxon implementation of the XQJ XQStaticContext interface
-
Constructor Summary
ConstructorsConstructorDescriptionCreate a SaxonXQStaticContext object as a copy of another SaxonXQStaticContext objectSaxonXQStaticContext(Configuration config) Create a SaxonXQStaticContext object, the Saxon implementation of XQStaticContext in XQJ -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckNotNull(Object arg) voiddeclareNamespace(String prefix, String uri) Declares a namespace prefix and associates it with a namespace URI.Gets the Base URI, if set in the static context, else the empty string.intGets the value of the binding mode property.intGets the boundary-space policy defined in the static context.intGets the construction mode defined in the static context.Gets the static type of the context item.intGets the inherit part of the copy-namespaces mode defined in the static context.intGets the preserve part of the copy-namespaces mode defined in the static context.Gets the URI of the default collation.Gets the URI of the default element/type namespace, the empty string if not set.Gets the URI of the default function namespace, the empty string if not set.intGets the default order for empty sequences defined in the static context.intGets the value of the holdability property.String[]Returns the prefixes of all the statically known namespaces.getNamespaceURI(String prefix) Retrieves the namespace URI associated with a prefix.intGets the ordering mode defined in the static context.intGets the value of the language type and version property.intRetrieves the number of seconds an implementation will wait for a query to execute.protected StaticQueryContextGet a new Saxon StaticQueryContext object holding the information held in this XQStaticContextintGets the value of the scrollability property.voidsetBaseURI(String baseUri) Sets the Base URI in the static context, specify the empty string to make it undefined.voidsetBindingMode(int bindingMode) Sets the binding mode property.voidsetBoundarySpacePolicy(int policy) Sets the boundary-space policy in the static context.voidsetConstructionMode(int mode) Sets the construction mode in the static context.voidsetContextItemStaticType(XQItemType contextItemType) Sets the static type of the context item, specifynullto make it unspecified.voidsetCopyNamespacesModeInherit(int mode) Sets the inherit part of the copy-namespaces mode in the static context.voidsetCopyNamespacesModePreserve(int mode) Sets the preserve part of the copy-namespaces mode in the static context.voidSets the URI of the default collation.voidSets the URI of the default element/type namespace, the empty string to make it unspecified.voidSets the URI of the default function namespace, the empty string to make it unspecified.voidsetDefaultOrderForEmptySequences(int order) Sets the default order for empty sequences in the static context.voidsetHoldability(int holdability) Sets the holdability property.voidsetOrderingMode(int mode) Sets the ordering mode in the static context.voidsetQueryLanguageTypeAndVersion(int langtype) Sets the input query language type and version.voidsetQueryTimeout(int seconds) Sets the number of seconds an implementation will wait for a query to execute.voidsetScrollability(int scrollability) Sets the scrollability of the result sequence.
-
Constructor Details
-
SaxonXQStaticContext
Create a SaxonXQStaticContext object, the Saxon implementation of XQStaticContext in XQJ- Parameters:
config- the Saxon configuration
-
SaxonXQStaticContext
Create a SaxonXQStaticContext object as a copy of another SaxonXQStaticContext object- Parameters:
sc- the static context to be copied
-
-
Method Details
-
getSaxonStaticQueryContext
Get a new Saxon StaticQueryContext object holding the information held in this XQStaticContext- Returns:
- a newly constructed StaticQueryContext object
-
declareNamespace
Description copied from interface:XQStaticContextDeclares 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.- Specified by:
declareNamespacein interfaceXQStaticContext- Parameters:
prefix- the prefix for the namespace URIuri- the namespace URI. An empty string undeclares the specific prefix. Cannot benull- Throws:
XQException- if (1) anullprefix, or (2) anullnamespace URI is specified
-
getBaseURI
Description copied from interface:XQStaticContextGets the Base URI, if set in the static context, else the empty string.- Specified by:
getBaseURIin interfaceXQStaticContext- Returns:
- the base URI, if set, else the empty string.
Cannot be
null..
-
getBindingMode
public int getBindingMode()Description copied from interface:XQStaticContextGets the value of the binding mode property. By default an XQJ implementation operates in immediate binding mode.- Specified by:
getBindingModein interfaceXQStaticContext- Returns:
- the binding mode. One of
XQConstants.BINDING_MODE_IMMEDIATE, orXQConstants.BINDING_MODE_DEFERRED.
-
getBoundarySpacePolicy
public int getBoundarySpacePolicy()Description copied from interface:XQStaticContextGets the boundary-space policy defined in the static context.- Specified by:
getBoundarySpacePolicyin interfaceXQStaticContext- Returns:
- the boundary-space policy value. One of:
XQConstants.BOUNDARY_SPACE_PRESERVE,XQConstants.BOUNDARY_SPACE_STRIP.
-
getConstructionMode
public int getConstructionMode()Description copied from interface:XQStaticContextGets the construction mode defined in the static context.- Specified by:
getConstructionModein interfaceXQStaticContext- Returns:
- construction mode value. One of:
XQConstants.CONSTRUCTION_MODE_PRESERVE,XQConstants.CONSTRUCTION_MODE_STRIP
-
getContextItemStaticType
Description copied from interface:XQStaticContextGets the static type of the context item.nullif unspecified.- Specified by:
getContextItemStaticTypein interfaceXQStaticContext- Returns:
- the static type of the context item,
if set, else
null
-
getCopyNamespacesModeInherit
public int getCopyNamespacesModeInherit()Description copied from interface:XQStaticContextGets the inherit part of the copy-namespaces mode defined in the static context.- Specified by:
getCopyNamespacesModeInheritin interfaceXQStaticContext- Returns:
- construction mode value. One of:
XQConstants.COPY_NAMESPACES_MODE_INHERIT,XQConstants.COPY_NAMESPACES_MODE_NO_INHERIT.
-
getCopyNamespacesModePreserve
public int getCopyNamespacesModePreserve()Description copied from interface:XQStaticContextGets the preserve part of the copy-namespaces mode defined in the static context.- Specified by:
getCopyNamespacesModePreservein interfaceXQStaticContext- Returns:
- construction mode value. One of:
XQConstants.COPY_NAMESPACES_MODE_PRESERVE,XQConstants.COPY_NAMESPACES_MODE_NO_PRESERVE.
-
getDefaultCollation
Description copied from interface:XQStaticContextGets the URI of the default collation.- Specified by:
getDefaultCollationin interfaceXQStaticContext- Returns:
- the URI of the default collation.
Cannot be
null.
-
getDefaultElementTypeNamespace
Description copied from interface:XQStaticContextGets the URI of the default element/type namespace, the empty string if not set.- Specified by:
getDefaultElementTypeNamespacein interfaceXQStaticContext- Returns:
- the URI of the default element/type namespace,
if set, else the empty string. Cannot be
null
-
getDefaultFunctionNamespace
Description copied from interface:XQStaticContextGets the URI of the default function namespace, the empty string if not set.- Specified by:
getDefaultFunctionNamespacein interfaceXQStaticContext- Returns:
- the URI of the default function namespace,
if set, else the empty string. Cannot be
null
-
getDefaultOrderForEmptySequences
public int getDefaultOrderForEmptySequences()Description copied from interface:XQStaticContextGets the default order for empty sequences defined in the static context.- Specified by:
getDefaultOrderForEmptySequencesin interfaceXQStaticContext- Returns:
- default order for empty sequences value. One of:
XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_GREATEST,XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_LEAST.
-
getNamespacePrefixes
Description copied from interface:XQStaticContextReturns the prefixes of all the statically known namespaces. Use thegetNamespaceURImethod to look up the namespace URI corresponding to a specific prefix.- Specified by:
getNamespacePrefixesin interfaceXQStaticContext- Returns:
Stringarray containing the namespace prefixes. Cannot benull
-
getNamespaceURI
Description copied from interface:XQStaticContextRetrieves the namespace URI associated with a prefix. AnXQExceptionis thrown if an unknown prefix is specified, i.e. a prefix not returned by thegetInScopeNamespacePrefixesmethod.- Specified by:
getNamespaceURIin interfaceXQStaticContext- Parameters:
prefix- the prefix for which the namespace URI is sought. Cannot benull- Returns:
- the namespace URI. Cannot be
null - Throws:
XQException- if anullprefix is specified or if the prefix is unknown
-
getOrderingMode
public int getOrderingMode()Description copied from interface:XQStaticContextGets the ordering mode defined in the static context.- Specified by:
getOrderingModein interfaceXQStaticContext- Returns:
- ordering mode value. One of:
XQConstants.ORDERING_MODE_ORDERED,XQConstants.ORDERING_MODE_UNORDERED.
-
getHoldability
public int getHoldability()Description copied from interface:XQStaticContextGets the value of the holdability property.- Specified by:
getHoldabilityin interfaceXQStaticContext- Returns:
- the type of a result's holdability. One of:
XQConstants.HOLDTYPE_HOLD_CURSORS_OVER_COMMIT, orXQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT.
-
getQueryLanguageTypeAndVersion
public int getQueryLanguageTypeAndVersion()Description copied from interface:XQStaticContextGets the value of the language type and version property. By default an XQJ implementation's default isXQConstants.LANGTYPE_XQUERY.- Specified by:
getQueryLanguageTypeAndVersionin interfaceXQStaticContext- Returns:
- the language type and version. One of:
XQConstants.LANGTYPE_XQUERY, orXQConstants.LANGTYPE_XQUERYXor a negative value indicating a vendor specific query language type and version.
-
getQueryTimeout
public int getQueryTimeout()Description copied from interface:XQStaticContextRetrieves the number of seconds an implementation will wait for a query to execute.- Specified by:
getQueryTimeoutin interfaceXQStaticContext- Returns:
- the query execution timeout value in seconds. A value of 0 indicates no limit.
-
getScrollability
public int getScrollability()Description copied from interface:XQStaticContextGets the value of the scrollability property. By default query results are forward only.- Specified by:
getScrollabilityin interfaceXQStaticContext- Returns:
- the type of a result's scrollability. One of:
XQConstants.SCROLLTYPE_FORWARD_ONLY, orXQConstants.SCROLLTYPE_SCROLLABLE.
-
setBaseURI
Description copied from interface:XQStaticContextSets the Base URI in the static context, specify the empty string to make it undefined.- Specified by:
setBaseURIin interfaceXQStaticContext- Parameters:
baseUri- the new baseUri, or empty string to make it undefined. Cannot benull.- Throws:
XQException- if anullbase uri is specified
-
setBindingMode
Description copied from interface:XQStaticContextSets the binding mode property. By default an XQJ implementation operates in immediate binding mode.- Specified by:
setBindingModein interfaceXQStaticContext- Parameters:
bindingMode- the binding mode. One of:XQConstants.BINDING_MODE_IMMEDIATE, orXQConstants.BINDING_MODE_DEFERRED.- Throws:
XQException- the specified mode is different fromXQConstants.BINDING_MODE_IMMEDIATE,XQConstants.BINDING_MODE_DEFERRED
-
setBoundarySpacePolicy
Description copied from interface:XQStaticContextSets the boundary-space policy in the static context.- Specified by:
setBoundarySpacePolicyin interfaceXQStaticContext- Parameters:
policy- boundary space policy. One of:XQConstants.BOUNDARY_SPACE_PRESERVE,XQConstants.BOUNDARY_SPACE_STRIP.- Throws:
XQException- the specified mode is different fromXQConstants.BOUNDARY_SPACE_PRESERVE,XQConstants.BOUNDARY_SPACE_STRIP
-
setConstructionMode
Description copied from interface:XQStaticContextSets the construction mode in the static context.- Specified by:
setConstructionModein interfaceXQStaticContext- Parameters:
mode- construction mode value. One of:XQConstants.CONSTRUCTION_MODE_PRESERVE,XQConstants.CONSTRUCTION_MODE_STRIP.- Throws:
XQException- the specified mode is different fromXQConstants.CONSTRUCTION_MODE_PRESERVE,XQConstants.CONSTRUCTION_MODE_STRIP
-
setContextItemStaticType
Description copied from interface:XQStaticContextSets the static type of the context item, specifynullto make it unspecified.- Specified by:
setContextItemStaticTypein interfaceXQStaticContext- Parameters:
contextItemType- the static type of the context item;nullif unspecified.
-
setCopyNamespacesModeInherit
Description copied from interface:XQStaticContextSets the inherit part of the copy-namespaces mode in the static context.- Specified by:
setCopyNamespacesModeInheritin interfaceXQStaticContext- Parameters:
mode- ordering mode value. One of:XQConstants.COPY_NAMESPACES_MODE_INHERIT,XQConstants.COPY_NAMESPACES_MODE_NO_INHERIT.- Throws:
XQException- the specified mode is different fromXQConstants.COPY_NAMESPACES_MODE_INHERIT,XQConstants.COPY_NAMESPACES_MODE_NO_INHERIT
-
setCopyNamespacesModePreserve
Description copied from interface:XQStaticContextSets the preserve part of the copy-namespaces mode in the static context.- Specified by:
setCopyNamespacesModePreservein interfaceXQStaticContext- Parameters:
mode- ordering mode value. One of:XQConstants.COPY_NAMESPACES_MODE_PRESERVE,XQConstants.COPY_NAMESPACES_MODE_NO_PRESERVE.- Throws:
XQException- the specified mode is different fromXQConstants.COPY_NAMESPACES_MODE_PRESERVE,XQConstants.COPY_NAMESPACES_MODE_NO_PRESERVE
-
setDefaultCollation
Description copied from interface:XQStaticContextSets the URI of the default collation.- Specified by:
setDefaultCollationin interfaceXQStaticContext- Parameters:
uri- the namespace URI of the default collation. Cannot benull.- Throws:
XQException- if anullURI is specified
-
setDefaultElementTypeNamespace
Description copied from interface:XQStaticContextSets the URI of the default element/type namespace, the empty string to make it unspecified.- Specified by:
setDefaultElementTypeNamespacein interfaceXQStaticContext- Parameters:
uri- the namespace URI of the default element/type namespace, the empty string to make it unspecified. Cannot benull.- Throws:
XQException- if anulluri is specified
-
setDefaultFunctionNamespace
Description copied from interface:XQStaticContextSets the URI of the default function namespace, the empty string to make it unspecified.- Specified by:
setDefaultFunctionNamespacein interfaceXQStaticContext- Parameters:
uri- the namespace URI of the default function namespace, the empty string to make it unspecified. Cannot benull.- Throws:
XQException- if anullURI is specified
-
setDefaultOrderForEmptySequences
Description copied from interface:XQStaticContextSets the default order for empty sequences in the static context.- Specified by:
setDefaultOrderForEmptySequencesin interfaceXQStaticContext- Parameters:
order- the default order for empty sequences. One of:XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_GREATEST,XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_LEAST.- Throws:
XQException- the specified order for empty sequences is different fromXQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_GREATEST,XQConstants.DEFAULT_ORDER_FOR_EMPTY_SEQUENCES_LEAST
-
setOrderingMode
Description copied from interface:XQStaticContextSets the ordering mode in the static context.- Specified by:
setOrderingModein interfaceXQStaticContext- Parameters:
mode- ordering mode value. One of:XQConstants.ORDERING_MODE_ORDERED,XQConstants.ORDERING_MODE_UNORDERED.- Throws:
XQException- the specified mode is different fromXQConstants.ORDERING_MODE_ORDERED,XQConstants.ORDERING_MODE_UNORDERED
-
setQueryTimeout
Description copied from interface:XQStaticContextSets 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.- Specified by:
setQueryTimeoutin interfaceXQStaticContext- Parameters:
seconds- the query execution timeout value in seconds. A value of 0 indicates no limit- Throws:
XQException- if the passed in value is negative
-
setHoldability
Description copied from interface:XQStaticContextSets the holdability property.- Specified by:
setHoldabilityin interfaceXQStaticContext- Parameters:
holdability- the holdability of the result. One of:XQConstants.HOLDTYPE_HOLD_CURSORS_OVER_COMMIT, orXQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT.- Throws:
XQException- the specified holdability is different fromXQConstants.HOLDTYPE_HOLD_CURSORS_OVER_COMMIT,XQConstants.HOLDTYPE_CLOSE_CURSORS_AT_COMMIT
-
setQueryLanguageTypeAndVersion
Description copied from interface:XQStaticContextSets 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.- Specified by:
setQueryLanguageTypeAndVersionin interfaceXQStaticContext- Parameters:
langtype- the query language type and version of the inputs. One of:XQConstants.LANGTYPE_XQUERY(default), orXQConstants.LANGTYPE_XQUERYX. A negative number indicates a vendor specific query language type and version.- Throws:
XQException- the specified langtype is different fromXQConstants.LANGTYPE_XQUERY,XQConstants.LANGTYPE_XQUERYXand is not negative
-
setScrollability
Description copied from interface:XQStaticContextSets the scrollability of the result sequence. By default query results are forward only.- Specified by:
setScrollabilityin interfaceXQStaticContext- Parameters:
scrollability- the scrollability of the result. One of:XQConstants.SCROLLTYPE_FORWARD_ONLY, orXQConstants.SCROLLTYPE_SCROLLABLE.- Throws:
XQException- the specified crollability type is different fromXQConstants.SCROLLTYPE_FORWARD_ONLY,XQConstants.SCROLLTYPE_SCROLLABLE
-
checkNotNull
- Throws:
XQException
-