MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.contextConfig
Interface XQStaticContext

All Known Implementing Classes:
Context

public interface XQStaticContext


Field Summary
static java.lang.String CODEPOINT_COLLATION_URI
           
static java.lang.String COPY_MODE_INHERIT
           
static java.lang.String COPY_MODE_NO_INHERIT
           
static java.lang.String COPY_MODE_NO_PRESERVE
           
static java.lang.String COPY_MODE_PRESERVE
           
static java.lang.String NS_ERR
           
static java.lang.String NS_XML
           
static java.lang.String NS_XMLNS
           
static java.lang.String ORDER_GREATEST
           
static java.lang.String ORDER_LEAST
           
static java.lang.String ORDERED
           
static java.lang.String PRESERVE
           
static int REVALIDATION_LAX
           
static int REVALIDATION_SKIP
           
static int REVALIDATION_STRICT
           
static java.lang.String STRIP
           
static java.lang.String UNORDERED
           
static java.lang.String URI_ERR
           
static java.lang.String URI_FN
           
static java.lang.String URI_LOCAL
           
static java.lang.String URI_XDT
           
static java.lang.String URI_XML
           
static java.lang.String URI_XMLNS
           
static java.lang.String URI_XS
           
static java.lang.String URI_XSI
           
 
Method Summary
 java.lang.String addAnonymousNamespace(java.lang.String uri)
          This methods adds a new namespace to the context and returns the prefix (if the namespace already exists) or creates an anonymous namespace just for internal use
 void addFunction(Function function)
          Adds a function to the context
 void addFunction(Function function, boolean checkExistence, boolean external)
          Adds a function to the context
 void addModuleLocation(java.lang.String moduleNS_URI, java.lang.String location)
          Add the locations URI where the contents of a module identified by the namespace moduleNS_URI can be found
 void addNamespace(Namespace ns)
          Add a namespace mapping.
 void addNamespace(java.lang.String prefix, java.lang.String uri)
          Add a prefix/namespace mapping.
 void addSchemaLocation(java.lang.String schemaURI, java.lang.String schemaLocation)
           
 boolean checkVariable(QName qname)
          Check if the variable is defined
 void clearModuleLocation()
          Clear this list of locations mapping between module identifiers and locations
 java.util.Hashtable getAllNamespaces()
           
 java.util.Vector getAllNsURI()
           
 java.util.Hashtable getAllVariables()
           
 java.lang.String getBaseURI()
          Get the base URI.
 Set getCollations()
          Get the statically known collations
 java.lang.String getConstructionMode()
          Gets the construction mode of the Context
 boolean getCopyNamespacesInheritMode()
          Returns which Inherit setting of the copy namespace mode is set
 boolean getCopyNamespacesPreserveMode()
          Returns which Preserve setting of the copy namespace mode is set
 java.lang.String getDefaultCollation()
          Get the default collation
 java.lang.String getDefaultElementNamespace()
          Gets the defaultElementNamespace attribute of the Context object
 java.lang.String getDefaultElementPrefix()
          Returns the default function prefix, which can be an anonymous prefix
 java.lang.String getDefaultFunctionNamespace()
          Gets the defaultFunctionNamespace attribute of the Context object
 java.lang.String getDefaultFunctionPrefix()
          Returns the default function prefix, which can be an anonymous prefix
 java.lang.String getDefaultOrderEmptySequence()
          Returns the default order for empty sequences
 int getFTCase()
          Set the Full Text Case Option
 java.lang.String getFTLanguage()
          Get the Full Text Language Option
 FTStopWordsMatchOption getFTStopWords()
          Get the full text stopwords option, i.e.
 FTThesaurusMatchOption getFTThesaurus()
          Set the full text thesaurus option, i.e.
 Function getFunction(QName qname, int arity)
          Get a function with a name and number of parameters
 java.util.Hashtable getFunctions(java.lang.String namespace)
          Get all functions with in particular namespace
 java.lang.String getLocationOfSchema(java.lang.String schemaURI)
           
 java.util.Vector getModuleLocation(java.lang.String moduleNS_URI)
          Retrieve the list of locations where the contents of the module are stored
 Namespace getNamespace(java.lang.String prefix)
          Gets the namespace URI associated with the given prefix
 java.lang.String getOrderingMode()
           
 java.lang.String getPrefix(java.lang.String uri)
          get the (namespace-)prefix for a given URI.
 int getRevalidationMode()
          Return the revalidation mode for update expressions
 boolean getsetBoundarySpaceHandling()
          Gets the whitespaceHandling attribute of the Context object
 java.util.Hashtable getWSFunctions(java.lang.String namespace)
           
 boolean isFTDiacriticsSensitive()
          Get the full text diacritics sensitive option
 boolean isFTStemming()
          Get the full text stemming option, i.e.
 boolean isFTWildcard()
          Get the full text wildcard option, i.e.
 boolean isXPath10Compat()
          Get the XPath 1.0 Compatibility setting
 QName registerAnonymousVariable()
          Registers a new "anonymous" (=internal) variable
 void registerNewContextItem()
          Registers a new context item in this scope
 void registerVariable(QName qname, boolean isFFLWOR)
          Registers a new variable.
 void registerVariable(QName qname, boolean external, boolean isFFLWOR, XDMIterator seqTypeIter, boolean assignable)
          Registers a new variable.
 void registerVariable(QName qname, boolean external, boolean isFFLWOR, XDMIterator seqTypeIter, boolean resolve, boolean assignable)
          Registers a new variable.
 void registerVariable(QName qname, boolean isFFLWOR, XDMIterator seqTypeIter, boolean assignable)
          Registers a new variable.
 void removeNamespace(java.lang.String prefix)
          Remove a prefix/namespace from mapping.
 void setBaseURI(java.lang.String uri)
          Sets the base URI.
 void setBoundarySpaceHandling(boolean value)
          Sets the boundary Space Handling attribute of the Context object
 void setConstructionMode(java.lang.String value)
          Sets the construction mode of the Context
 void setCopyNamespacesMode(boolean preserve, boolean inherit)
          Set the copy namespaces modes for element construction, see 3.7.1.3 and 4.9 of the spec
 void setDefaultCollation(java.lang.String coll)
           
 void setDefaultElementNamespace(java.lang.String URI)
          Sets the defaultElementNamespace attribute of the Context object
 void setDefaultFunctionNamespace(java.lang.String URI)
          Sets the defaultFunctionNamespace attribute of the Context object
 void setDefaultOrderEmptySequence(java.lang.String value)
          Sets the default order for empty sequences.
 void setFTCase(int caseOpt)
          Set the Full Text Case Option
 void setFTDiacriticsSensitive(boolean sensitive)
          Set the full text diacritics sensitive option (i.e.
 void setFTLanguage(java.lang.String lan)
          Set the Full Text Language Option
 void setFTStemming(boolean stemming)
          Set the full text stemming option, i.e.
 void setFTStopwords(FTStopWordsMatchOption sw)
          Set the full text stopwords option, i.e.
 void setFTThesaurus(FTThesaurusMatchOption thes)
          Set the full text thesaurus option, i.e.
 void setFTWildcard(boolean wildcards)
          Set the full text wildcard option, i.e.
 void setOrderingMode(java.lang.String value)
          Sets the Ordering mode, which has the value ordered or unordered, affects the ordering of the result sequence returned by certain path expressions, union, intersect, and except expressions, and FLWOR expressions that have no order by clause.] Details are provided in the descriptions of these expressions.
 void setRevalidationMode(int valMode)
          Set the revalidation mode for update expressions
 

Field Detail

PRESERVE

static final java.lang.String PRESERVE
See Also:
Constant Field Values

STRIP

static final java.lang.String STRIP
See Also:
Constant Field Values

ORDERED

static final java.lang.String ORDERED
See Also:
Constant Field Values

UNORDERED

static final java.lang.String UNORDERED
See Also:
Constant Field Values

ORDER_GREATEST

static final java.lang.String ORDER_GREATEST
See Also:
Constant Field Values

ORDER_LEAST

static final java.lang.String ORDER_LEAST
See Also:
Constant Field Values

COPY_MODE_PRESERVE

static final java.lang.String COPY_MODE_PRESERVE
See Also:
Constant Field Values

COPY_MODE_NO_PRESERVE

static final java.lang.String COPY_MODE_NO_PRESERVE
See Also:
Constant Field Values

COPY_MODE_INHERIT

static final java.lang.String COPY_MODE_INHERIT
See Also:
Constant Field Values

COPY_MODE_NO_INHERIT

static final java.lang.String COPY_MODE_NO_INHERIT
See Also:
Constant Field Values

REVALIDATION_LAX

static final int REVALIDATION_LAX
See Also:
Constant Field Values

REVALIDATION_STRICT

static final int REVALIDATION_STRICT
See Also:
Constant Field Values

REVALIDATION_SKIP

static final int REVALIDATION_SKIP
See Also:
Constant Field Values

CODEPOINT_COLLATION_URI

static final java.lang.String CODEPOINT_COLLATION_URI
See Also:
Constant Field Values

URI_FN

static final java.lang.String URI_FN
See Also:
Constant Field Values

NS_XML

static final java.lang.String NS_XML
See Also:
Constant Field Values

URI_XML

static final java.lang.String URI_XML
See Also:
Constant Field Values

URI_XS

static final java.lang.String URI_XS
See Also:
Constant Field Values

URI_XSI

static final java.lang.String URI_XSI
See Also:
Constant Field Values

URI_XDT

static final java.lang.String URI_XDT
See Also:
Constant Field Values

URI_LOCAL

static final java.lang.String URI_LOCAL
See Also:
Constant Field Values

NS_XMLNS

static final java.lang.String NS_XMLNS
See Also:
Constant Field Values

URI_XMLNS

static final java.lang.String URI_XMLNS
See Also:
Constant Field Values

NS_ERR

static final java.lang.String NS_ERR
See Also:
Constant Field Values

URI_ERR

static final java.lang.String URI_ERR
See Also:
Constant Field Values
Method Detail

setOrderingMode

void setOrderingMode(java.lang.String value)
                     throws MXQueryException
Sets the Ordering mode, which has the value ordered or unordered, affects the ordering of the result sequence returned by certain path expressions, union, intersect, and except expressions, and FLWOR expressions that have no order by clause.] Details are provided in the descriptions of these expressions.

Throws:
MXQueryException

getOrderingMode

java.lang.String getOrderingMode()

setDefaultOrderEmptySequence

void setDefaultOrderEmptySequence(java.lang.String value)
                                  throws MXQueryException
Sets the default order for empty sequences. This component controls the processing of empty sequences and NaN values as ordering keys in an order by clause in a FLWOR expression, as described in 3.8.3 Order By and Return Clauses. Its value may be greatest or least.

Parameters:
value -
Throws:
MXQueryException

getDefaultOrderEmptySequence

java.lang.String getDefaultOrderEmptySequence()
Returns the default order for empty sequences

Returns:
ORDER_GREATEST or ORDER_LEAST

setCopyNamespacesMode

void setCopyNamespacesMode(boolean preserve,
                           boolean inherit)
Set the copy namespaces modes for element construction, see 3.7.1.3 and 4.9 of the spec

Parameters:
preserve - keep the namespaces of the original element
inherit - inherit namespaces of the enclosing constructed element

getCopyNamespacesInheritMode

boolean getCopyNamespacesInheritMode()
Returns which Inherit setting of the copy namespace mode is set

Returns:
false if NO INHERIT set, otherwise true

getCopyNamespacesPreserveMode

boolean getCopyNamespacesPreserveMode()
Returns which Preserve setting of the copy namespace mode is set

Returns:
false if NO PRESERVER set, otherwise true

getAllNamespaces

java.util.Hashtable getAllNamespaces()
Returns:
All the visible namespace prefix-URI mappings.

getAllVariables

java.util.Hashtable getAllVariables()
Returns:
All the visible name-variable mappings.

getBaseURI

java.lang.String getBaseURI()
Get the base URI.

Returns:
Returns said URI.

setBaseURI

void setBaseURI(java.lang.String uri)
Sets the base URI.

Parameters:
uri - The URI to set.

getConstructionMode

java.lang.String getConstructionMode()
Gets the construction mode of the Context

Returns:
The construction mode value

getDefaultElementNamespace

java.lang.String getDefaultElementNamespace()
Gets the defaultElementNamespace attribute of the Context object

Returns:
The defaultElementNamespace value

getDefaultElementPrefix

java.lang.String getDefaultElementPrefix()
Returns the default function prefix, which can be an anonymous prefix

Returns:
a string expressing the default element prefix

getDefaultFunctionNamespace

java.lang.String getDefaultFunctionNamespace()
Gets the defaultFunctionNamespace attribute of the Context object

Returns:
The defaultFunctionNamespace value

getDefaultFunctionPrefix

java.lang.String getDefaultFunctionPrefix()
Returns the default function prefix, which can be an anonymous prefix

Returns:
a String representing the default function namespace prefix

getNamespace

Namespace getNamespace(java.lang.String prefix)
Gets the namespace URI associated with the given prefix

Parameters:
prefix - The given prefix
Returns:
The associated namespace URI

getPrefix

java.lang.String getPrefix(java.lang.String uri)
get the (namespace-)prefix for a given URI. This acutally iterates through the context entries. This iteration is acceptable, because this method is very rarely used.

Parameters:
uri - The URI to look for.
Returns:
the Namespace object for this prefix

addNamespace

void addNamespace(Namespace ns)
                  throws MXQueryException
Add a namespace mapping.

Parameters:
ns - a namespace object containing prefix and uri
Throws:
MXQueryException

addNamespace

void addNamespace(java.lang.String prefix,
                  java.lang.String uri)
                  throws MXQueryException
Add a prefix/namespace mapping.

Parameters:
prefix - The prefix.
uri - The URI of the namespace.
Throws:
MXQueryException

getAllNsURI

java.util.Vector getAllNsURI()

removeNamespace

void removeNamespace(java.lang.String prefix)
Remove a prefix/namespace from mapping.

Parameters:
prefix - The prefix of the namespace to be removed

setConstructionMode

void setConstructionMode(java.lang.String value)
Sets the construction mode of the Context

Parameters:
value - The construction mode value

setDefaultElementNamespace

void setDefaultElementNamespace(java.lang.String URI)
                                throws MXQueryException
Sets the defaultElementNamespace attribute of the Context object

Parameters:
URI - The new defaultElementNamespace value
Throws:
MXQueryException

setDefaultFunctionNamespace

void setDefaultFunctionNamespace(java.lang.String URI)
                                 throws MXQueryException
Sets the defaultFunctionNamespace attribute of the Context object

Parameters:
URI - The new defaultFunctionNamespace value
Throws:
MXQueryException

setBoundarySpaceHandling

void setBoundarySpaceHandling(boolean value)
Sets the boundary Space Handling attribute of the Context object

Parameters:
value - true - preserve false not preserve

addFunction

void addFunction(Function function,
                 boolean checkExistence,
                 boolean external)
                 throws MXQueryException
Adds a function to the context

Parameters:
function -
Throws:
MXQueryException

addFunction

void addFunction(Function function)
                 throws MXQueryException
Adds a function to the context

Parameters:
function -
Throws:
MXQueryException

getFunctions

java.util.Hashtable getFunctions(java.lang.String namespace)
Get all functions with in particular namespace

Parameters:
namespace - the namespace in which the functions must be
Returns:
a Hashtable containing (FunctionSignate->Function) entries

getFunction

Function getFunction(QName qname,
                     int arity)
                     throws MXQueryException
Get a function with a name and number of parameters

Parameters:
qname - the name of the function
arity - the number of parameters
Returns:
A function Object containing both the exact signature and means to get the implementation
Throws:
MXQueryException

getsetBoundarySpaceHandling

boolean getsetBoundarySpaceHandling()
Gets the whitespaceHandling attribute of the Context object

Returns:
The whitespaceHandling value

getCollations

Set getCollations()
Get the statically known collations

Returns:
The set of Collations known to the engine

getDefaultCollation

java.lang.String getDefaultCollation()
Get the default collation

Returns:
A String/URI describing the default collation

setDefaultCollation

void setDefaultCollation(java.lang.String coll)
                         throws MXQueryException
Throws:
MXQueryException

getRevalidationMode

int getRevalidationMode()
Return the revalidation mode for update expressions

Returns:
one of REVALIDATION_LAX, REVALIDATION_STRICT, REVALIDATION_SKIP

setRevalidationMode

void setRevalidationMode(int valMode)
                         throws MXQueryException
Set the revalidation mode for update expressions

Parameters:
valMode - one of REVALIDATION_LAX, REVALIDATION_STRICT, REVALIDATION_SKIP
Throws:
MXQueryException - If an invalid or unsupported revalidation mode was specified

setFTLanguage

void setFTLanguage(java.lang.String lan)
Set the Full Text Language Option

Parameters:
lan -

getFTLanguage

java.lang.String getFTLanguage()
Get the Full Text Language Option

Returns:
the language identifier (e.g. "en") for the language option

setFTCase

void setFTCase(int caseOpt)
Set the Full Text Case Option

Parameters:
caseOpt - one of FTCaseMatchOption.CASE_INSENSITIVE, CASE_SENSITIVE, CASE_LOWERCASE, CASE_UPPERCASE

getFTCase

int getFTCase()
Set the Full Text Case Option

Returns:
one of FTCaseMatchOption.CASE_INSENSITIVE, CASE_SENSITIVE, CASE_LOWERCASE, CASE_UPPERCASE

setFTDiacriticsSensitive

void setFTDiacriticsSensitive(boolean sensitive)
Set the full text diacritics sensitive option (i.e. if diacritics should be considered or not)

Parameters:
sensitive -

isFTDiacriticsSensitive

boolean isFTDiacriticsSensitive()
Get the full text diacritics sensitive option

Returns:
true diacritics sensitive, false not sensitive

setFTStemming

void setFTStemming(boolean stemming)
Set the full text stemming option, i.e. if stemming should be used in the matching

Parameters:
stemming - true stemming should be used, no stemming should not be used

isFTStemming

boolean isFTStemming()
Get the full text stemming option, i.e. if stemming should be used in the matching

Returns:
true stemming should be used, no stemming should not be used

setFTWildcard

void setFTWildcard(boolean wildcards)
Set the full text wildcard option, i.e. if wildcards should be used in the matching

Parameters:
wildcards - true wildcards should be used, no wildscards should not be used

isFTWildcard

boolean isFTWildcard()
Get the full text wildcard option, i.e. if wildcards should be used in the matching

Returns:
true wildcards should be used, no wildscards should not be used

setFTStopwords

void setFTStopwords(FTStopWordsMatchOption sw)
Set the full text stopwords option, i.e. which stopwords should be used in the matching

Parameters:
sw - A FTStopWordsMatchOption object describing the stopwords

getFTStopWords

FTStopWordsMatchOption getFTStopWords()
Get the full text stopwords option, i.e. which stopwords should be used in the matching

Returns:
A FTStopWordsMatchOption object describing the stopwords

setFTThesaurus

void setFTThesaurus(FTThesaurusMatchOption thes)
Set the full text thesaurus option, i.e. which thesauri should be used in the matching

Parameters:
thes - A FTThesaurusMatchOption object describing the thesauri

getFTThesaurus

FTThesaurusMatchOption getFTThesaurus()
Set the full text thesaurus option, i.e. which thesauri should be used in the matching

Returns:
A FTThesaurusMatchOption object describing the thesauri

isXPath10Compat

boolean isXPath10Compat()
Get the XPath 1.0 Compatibility setting

Returns:
the XPath 1.0 compatibility setting - always false

registerVariable

void registerVariable(QName qname,
                      boolean isFFLWOR)
                      throws MXQueryException
Registers a new variable. If the variable already exists, an error is thrown.

Parameters:
qname -
isFFLWOR -
Throws:
MXQueryException

registerVariable

void registerVariable(QName qname,
                      boolean isFFLWOR,
                      XDMIterator seqTypeIter,
                      boolean assignable)
                      throws MXQueryException
Registers a new variable. If the variable already exists, an error is thrown.

Parameters:
qname -
isFFLWOR -
seqTypeIter -
assignable -
Throws:
MXQueryException

registerNewContextItem

void registerNewContextItem()
                            throws MXQueryException
Registers a new context item in this scope

Throws:
MXQueryException

registerVariable

void registerVariable(QName qname,
                      boolean external,
                      boolean isFFLWOR,
                      XDMIterator seqTypeIter,
                      boolean assignable)
                      throws MXQueryException
Registers a new variable. If the variable already exists, an error is thrown.

Parameters:
qname -
external -
isFFLWOR -
seqTypeIter -
assignable -
Throws:
MXQueryException

registerVariable

void registerVariable(QName qname,
                      boolean external,
                      boolean isFFLWOR,
                      XDMIterator seqTypeIter,
                      boolean resolve,
                      boolean assignable)
                      throws MXQueryException
Registers a new variable. If the variable already exists, an error is thrown.

Parameters:
qname -
external -
isFFLWOR -
seqTypeIter -
resolve -
assignable -
Throws:
MXQueryException

registerAnonymousVariable

QName registerAnonymousVariable()
Registers a new "anonymous" (=internal) variable

Returns:
the QName of the registered variable

checkVariable

boolean checkVariable(QName qname)
                      throws MXQueryException
Check if the variable is defined

Parameters:
qname - the name of the variable
Returns:
true if the variable exists, false otherwise
Throws:
MXQueryException

addAnonymousNamespace

java.lang.String addAnonymousNamespace(java.lang.String uri)
                                       throws MXQueryException
This methods adds a new namespace to the context and returns the prefix (if the namespace already exists) or creates an anonymous namespace just for internal use

Parameters:
uri -
Returns:
the prefix of the anonymous namespace
Throws:
MXQueryException

getWSFunctions

java.util.Hashtable getWSFunctions(java.lang.String namespace)

addModuleLocation

void addModuleLocation(java.lang.String moduleNS_URI,
                       java.lang.String location)
Add the locations URI where the contents of a module identified by the namespace moduleNS_URI can be found

Parameters:
moduleNS_URI - Namespace of module
location - Location where to retrieve the module contents

getModuleLocation

java.util.Vector getModuleLocation(java.lang.String moduleNS_URI)
Retrieve the list of locations where the contents of the module are stored

Parameters:
moduleNS_URI - Namespace of the module
Returns:
the locations/URIs associated with this module

clearModuleLocation

void clearModuleLocation()
Clear this list of locations mapping between module identifiers and locations


addSchemaLocation

void addSchemaLocation(java.lang.String schemaURI,
                       java.lang.String schemaLocation)
Parameters:
schemaURI -
schemaLocation -

getLocationOfSchema

java.lang.String getLocationOfSchema(java.lang.String schemaURI)

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich