|
Qizx fe-4.4p2 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface XQueryContext
Definition of the XQuery Context used for compiling and executing Expressions. This serves both as Static and Dynamic context (in the sense of XQuery).
A XML Library
provides a default XQueryContext which can be
modified. This default context should be suitable for most applications,
with perhaps only a few properties to define, such as base-uri.
Before an Expression
is compiled, it inherits the context of the
Library from which the expression is created.
After an Expression is compiled, its XQueryContext reflects declarations made in the expression itself. The XQuery context can be inspected and runtime properties modified (mainly the default collation, implicit timezone, current date).
Field Summary | |
---|---|
static int |
INHERIT
Value used for property NamespaceInheritMode, meaning that namespaces should be inherited in a node copy operation. |
static int |
NO_INHERIT
Value used for property NamespaceInheritMode, meaning that namespaces should not be inherited in a node copy operation. |
static int |
NO_PRESERVE
Value used for properties BoundarySpacePolicy, NamespacePreserveMode, ConstructionMode, meaning that - respectively - boundary space, namespaces and schema types should not be preserved. |
static int |
ORDERED
Value returned by getOrderingMode(): indicates that by default result sequences must be ordered. |
static int |
PRESERVE
Value used for properties BoundarySpacePolicy, NamespacePreserveMode, ConstructionMode, meaning that - respectively - boundary space, namespaces and schema types should be preserved. |
static int |
UNORDERED
Value returned by getOrderingMode(): indicates that by default result sequences are not required to be ordered. |
Method Summary | |
---|---|
void |
declarePrefix(String prefix,
String namespaceURI)
Adds a predefined namespace declaration. |
void |
declareVariable(QName variableName,
SequenceType variableType)
Adds a predefined variable declaration. |
String |
getBaseURI()
Gets the base URI used to resolve relative URIs in expressions. |
int |
getBoundarySpacePolicy()
Gets the default boundary space policy for element constructors. |
int |
getConstructionMode()
Gets the construction mode defined in the static context. |
Date |
getCurrentDate()
Gets the specific date/time set by setCurrentDate(). |
String |
getDefaultCollation()
Gets the URI of the default collation defined in the static context. |
String |
getDefaultElementNamespace()
Gets the URI of the default element namespace. |
String |
getDefaultFunctionNamespace()
Gets the URI of the default function namespace. |
boolean |
getDefaultOrderEmptyGreatest()
Gets the default order for empty sequences in 'order by' clauses. |
TimeZone |
getImplicitTimeZone()
Returns the current implicit time-zone in the execution context. |
String[] |
getInScopePrefixes()
Returns the prefixes of in-scope namespace definitions. |
int |
getNamespaceInheritMode()
Gets the default inherit part of the copy-namespaces mode. |
int |
getNamespacePreserveMode()
Gets the default preserve part of the copy-namespaces mode. |
String |
getNamespaceURI(String prefix)
Retrieves the namespace URI associated with a prefix. |
QName[] |
getOptionNames()
Gets the list of options declared in the static context of a query. |
String |
getOptionValue(QName optionName)
Returns the string literal declared as value of the specified option. |
int |
getOrderingMode()
Gets the default ordering mode for returned sequences. |
boolean |
getStrictCompliance()
Returns true if a strict compliance with XQuery Specifications is enforced (not allowing extensions). |
boolean |
getStrictTyping()
Returns true if Strict Typing is enabled in this context. |
QName[] |
getVariableNames()
Gets the list of global variables declared in the static context. |
SequenceType |
getVariableType(QName variableName)
Returns the type associated with a declared variable. |
String |
getXQueryVersion()
Gets the supported version of XQuery. |
void |
setBaseURI(String uri)
Sets the base URI used to resolve relative URIs in expressions. |
void |
setBoundarySpacePolicy(int boundarySpacePolicy)
Sets the default boundary space policy for element constructors. |
void |
setConstructionMode(int constructionMode)
Sets the construction mode defined in the static context. |
void |
setCurrentDate(Date forcedDate)
Sets a specific date/time for use in query evaluation, instead of the normal value (the system time at start of evaluation). |
void |
setDefaultCollation(String defaultCollation)
Sets the URI of the default collation defined in the static context. |
void |
setDefaultElementNamespace(String defaultElementNamespace)
Sets the URI of the default element namespace. |
void |
setDefaultFunctionNamespace(String defaultFunctionNamespace)
Sets the URI of the default function namespace. |
void |
setDefaultOrderEmptyGreatest(boolean emptyGreatest)
Sets the default order for empty sequences in 'order by' clauses. |
void |
setImplicitTimeZone(TimeZone implicitTimeZone)
Defines the implicit time-zone in the execution context. |
void |
setNamespaceInheritMode(int namespaceInheritMode)
Sets the default inherit part of the copy-namespaces mode. |
void |
setNamespacePreserveMode(int namespacePreserveMode)
Sets the default preserve part of the copy-namespaces mode. |
void |
setOrderingMode(int orderingMode)
Sets the default ordering mode for returned sequences. |
void |
setStrictCompliance(boolean strictCompliance)
Sets the strict compliance flag with XQuery Specifications. |
void |
setStrictTyping(boolean strictTyping)
Sets the Strict Typing flag. |
Field Detail |
---|
static final int ORDERED
static final int UNORDERED
static final int PRESERVE
static final int NO_PRESERVE
static final int INHERIT
static final int NO_INHERIT
Method Detail |
---|
String getXQueryVersion()
boolean getDefaultOrderEmptyGreatest()
void setDefaultOrderEmptyGreatest(boolean emptyGreatest)
emptyGreatest
- true if the empty sequence or NaN are considered
greatest.int getNamespaceInheritMode()
void setNamespaceInheritMode(int namespaceInheritMode)
namespaceInheritMode
- the inherit mode to set, one of the two
values INHERIT or NO_INHERITint getNamespacePreserveMode()
void setNamespacePreserveMode(int namespacePreserveMode)
namespacePreserveMode
- the namespace preserve mode to set, one of
the two values PRESERVE or NO_PRESERVE.int getBoundarySpacePolicy()
void setBoundarySpacePolicy(int boundarySpacePolicy)
boundarySpacePolicy
- the boundary space policy to set, one of the
two values PRESERVE or NO_PRESERVE.int getConstructionMode()
void setConstructionMode(int constructionMode)
constructionMode
- the construction mode to set, one of the two
values PRESERVE or NO_PRESERVE.String getDefaultCollation()
void setDefaultCollation(String defaultCollation) throws DataModelException
defaultCollation
- the URI of the default collation to set
DataModelException
- if the collation cannot be resolvedString getDefaultElementNamespace()
void setDefaultElementNamespace(String defaultElementNamespace)
defaultElementNamespace
- default element namespace to setString getDefaultFunctionNamespace()
void setDefaultFunctionNamespace(String defaultFunctionNamespace)
defaultFunctionNamespace
- the default Function Namespace to set,
may not be nullint getOrderingMode()
void setOrderingMode(int orderingMode)
orderingMode
- the ordering mode to set, one of the two values
ORDERED or UNORDEREDString getBaseURI()
void setBaseURI(String uri)
uri
- the base URI, or the empty string. May not be nullString[] getInScopePrefixes()
void declarePrefix(String prefix, String namespaceURI)
If a namespace with the same prefix already exists, it is replaced.
prefix
- namespace prefix to be declarednamespaceURI
- URi of the namespace to be declaredString getNamespaceURI(String prefix)
prefix
- a namespace prefix
QName[] getVariableNames()
In the context of a compiled Expression, the variables are those declared
in the expression. In the context of a Library session or XQuerySession,
the variables can only have been predefined through the method
declareVariable(QName, SequenceType)
.
SequenceType getVariableType(QName variableName)
variableName
- qualified name of the variable
void declareVariable(QName variableName, SequenceType variableType)
variableName
- qualified name of the variablevariableType
- optional type (may be null) declared for the
variableQName[] getOptionNames()
In the context of a compiled Expression, the options are those declared in the prolog.
String getOptionValue(QName optionName)
optionName
- name of the option
void setImplicitTimeZone(TimeZone implicitTimeZone)
implicitTimeZone
- a TimeZone to be used as implicit time-zoneTimeZone getImplicitTimeZone()
boolean getStrictTyping()
setStrictTyping(boolean)
void setStrictTyping(boolean strictTyping)
If enabled (not by default), the XQuery compiler will treat as an error any weakly typed expression. This implies that nearly all variables or function parameters need to be declared with a type, and all user functions should have a declared return type. Since Qizx does not support Schema import, some expressions might in addition have to be typed through the use of treat as, casts and functions like fn:exactly-one, fn:one-or-more etc.
strictTyping
- true to enforce Strict TypinggetStrictTyping()
boolean getStrictCompliance()
setStrictCompliance(boolean)
void setStrictCompliance(boolean strictCompliance)
If not enabled (the default), the following extensions are available:
strictCompliance
- true to enforce strict compliancevoid setCurrentDate(Date forcedDate)
forcedDate
- a date/time, or null to use again the system time.Date getCurrentDate()
|
© 2010 Axyana Software | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |