MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

ch.ethz.mxquery.contextConfig
Interface XQDynamicContext

All Known Implementing Classes:
Context

public interface XQDynamicContext


Method Summary
 void bindVariableValue(QName qname, XDMIterator iter)
          Bind the value of this variable directly to XDM instance generated by the iterator
 VariableHolder getContextItem()
           
 MXQueryDateTime getCurrentTime()
          Get the "current" time (the time that was current when setCurrentTime(MXQueryDateTime) was called).
 MXQueryDayTimeDuration getCurrentTimeZone()
          Get the "current" time zone (at the time that was current when setCurrentTime(MXQueryDateTime) was called).
 int getPosition()
          Get the Context Position: the position of the context item within the current context
 StoreSet getStores()
          Returns the store set for XQueryUpdate.
 VariableHolder getVariable(QName qname)
          Get the reference to the variable and its binding
 VariableHolder getVariable(QName qname, boolean resolve)
          Get the reference to the variable and its binding
 void incVariableUse(QName qname)
          Indicate that there are more users for this variable
 void setContextItem(XDMIterator iter)
           
 void setCurrentTime(MXQueryDateTime dateTime)
          Stores the current time in the context.
 void setCurrentTimeZone(java.util.TimeZone tz)
          Set the current time zone
 void setPosition(int position)
          Set the Context Position: the position of the context item within the current context
 void setVariableValue(QName qname, XDMIterator iter)
          Set the value of this variable, implicitly creating/reusing stores if needed
 void setVariableValue(QName qname, XDMIterator iter, boolean check, boolean resolve)
          Set the value of this variable, implicitly creating/reusing stores if needed
 

Method Detail

getPosition

int getPosition()
Get the Context Position: the position of the context item within the current context

Returns:
-1 if not set, > 0 otherwise

setPosition

void setPosition(int position)
Set the Context Position: the position of the context item within the current context

Parameters:
position - the position to set, must be > 0

setVariableValue

void setVariableValue(QName qname,
                      XDMIterator iter,
                      boolean check,
                      boolean resolve)
                      throws MXQueryException
Set the value of this variable, implicitly creating/reusing stores if needed

Parameters:
qname - the variable name
iter - the iterator containing the XDM to set
check - if true, the non-existence of name causes an error, otherwise the variable is created
resolve - resolve/qualify name
Throws:
MXQueryException

setVariableValue

void setVariableValue(QName qname,
                      XDMIterator iter)
                      throws MXQueryException
Set the value of this variable, implicitly creating/reusing stores if needed

Parameters:
qname - the variable name
iter - the iterator containing the XDM to set
Throws:
MXQueryException

bindVariableValue

void bindVariableValue(QName qname,
                       XDMIterator iter)
                       throws MXQueryException
Bind the value of this variable directly to XDM instance generated by the iterator

Parameters:
qname - the variable name
iter - the iterator containing the XDM to bind
Throws:
MXQueryException

getVariable

VariableHolder getVariable(QName qname)
                           throws MXQueryException
Get the reference to the variable and its binding

Parameters:
qname - the name of the variable
Returns:
a VariableHolder containing information about the variable and its binding
Throws:
MXQueryException

getVariable

VariableHolder getVariable(QName qname,
                           boolean resolve)
                           throws MXQueryException
Get the reference to the variable and its binding

Parameters:
qname - the name of the variable
resolve - resolve the QName
Returns:
a VariableHolder containing information about the variable and its binding
Throws:
MXQueryException

incVariableUse

void incVariableUse(QName qname)
                    throws MXQueryException
Indicate that there are more users for this variable

Parameters:
qname - Variable name
Throws:
MXQueryException

getStores

StoreSet getStores()
Returns the store set for XQueryUpdate. At the moment only one storeset without nesting is allows


getCurrentTime

MXQueryDateTime getCurrentTime()
                               throws MXQueryException
Get the "current" time (the time that was current when setCurrentTime(MXQueryDateTime) was called).

Throws:
MXQueryException

getCurrentTimeZone

MXQueryDayTimeDuration getCurrentTimeZone()
                                          throws MXQueryException
Get the "current" time zone (at the time that was current when setCurrentTime(MXQueryDateTime) was called).

Throws:
MXQueryException

setCurrentTime

void setCurrentTime(MXQueryDateTime dateTime)
Stores the current time in the context. This should be used once at the start of the execution of a query. It is stored here to ensure that all calls to getCurrentTime return the same value.

Parameters:
dateTime - the time to set as current time - if null, the current system time is used

setCurrentTimeZone

void setCurrentTimeZone(java.util.TimeZone tz)
Set the current time zone

Parameters:
tz - a Time Zone

getContextItem

VariableHolder getContextItem()
                              throws MXQueryException
Throws:
MXQueryException

setContextItem

void setContextItem(XDMIterator iter)
                    throws MXQueryException
Throws:
MXQueryException

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich

MXQuery 0.6.0 API Documentation - Copyright 2006-2009 ETH Zurich