Package org.eclipse.wst.xml.xpath2.processor


org.eclipse.wst.xml.xpath2.processor
Class DefaultDynamicContext



public class DefaultDynamicContext
extends org.eclipse.wst.xml.xpath2.processor.internal.DefaultStaticContext
The default implementation of a Dynamic Context. Initializes and provides functionality of a dynamic context according to the XPath 2.0 specification.

Constructor Summary

DefaultDynamicContext(XSModel schema , org.w3c.dom.Document doc)
DefaultDynamicContext(org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel schema)

Method Summary

public voidadd_function_library(FunctionLibrary fl)
     Adds function definitions.
public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyTypecontext_item()
     Retrieve context item that is in focus
public intcontext_position()
     Retrieve the position of the focus
public java.util.GregorianCalendarcurrent_date_time()
     Gets the Current stable date time from the dynamic context.
public java.lang.Stringdefault_collation_name()
    
public org.eclipse.wst.xml.xpath2.processor.ResultSequenceevaluate_function(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name , java.util.Collection args)
    
public org.eclipse.wst.xml.xpath2.processor.internal.Focusfocus()
     Return the focus
public java.util.Comparatorget_collation(java.lang.String uri)
    
public org.eclipse.wst.xml.xpath2.processor.ResultSequenceget_doc(java.net.URI resolved)
     get document
public java.lang.Objectget_variable(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)
     Retrieve the variable name
public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModelgetTypeModel(org.w3c.dom.Node node)
    
public intlast()
     Retrieve the position of the last focus
public intnode_position(org.w3c.dom.Node node)
     Use focus().position() to retrieve the value.
public java.net.URIresolve_uri(java.lang.String uri)
    
public voidset_collation_provider(org.eclipse.wst.xml.xpath2.processor.CollationProvider provider)
    
public voidset_default_collation(java.lang.String _default_collation)
    
public voidset_focus(org.eclipse.wst.xml.xpath2.processor.internal.Focus f)
     Changes the current focus.
public voidset_variable(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var , org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType val)
     Sets the value of a variable.
public voidset_variable(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var , org.eclipse.wst.xml.xpath2.processor.ResultSequence val)
    
public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDurationtz()
     Reads the day from a TimeDuration type

Constructor Detail

DefaultDynamicContext

public DefaultDynamicContext(XSModel schema , org.w3c.dom.Document doc)

Constructor.


DefaultDynamicContext

public DefaultDynamicContext(org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel schema)

Constructor.


Methods Detail

add_function_library

public void add_function_library(FunctionLibrary fl)

Adds function definitions.

Parameters

fl - Function library to add.


context_item

public org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType context_item()

Retrieve context item that is in focus

Returns

org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType - an AnyType result from _focus.context_item()


context_position

public int context_position()

Retrieve the position of the focus

Returns

int - an integer result from _focus.position()


current_date_time

public java.util.GregorianCalendar current_date_time()

Gets the Current stable date time from the dynamic context.

Returns

java.util.GregorianCalendar


default_collation_name

public java.lang.String default_collation_name()

Returns

java.lang.String


evaluate_function

public org.eclipse.wst.xml.xpath2.processor.ResultSequence evaluate_function(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name , java.util.Collection args)

Parameters

name

args

Returns

org.eclipse.wst.xml.xpath2.processor.ResultSequence - a ResultSequence from funct.evaluate(args)

Throws:

org.eclipse.wst.xml.xpath2.processor.DynamicError


focus

public org.eclipse.wst.xml.xpath2.processor.internal.Focus focus()

Return the focus

Returns

org.eclipse.wst.xml.xpath2.processor.internal.Focus - _focus


get_collation

public java.util.Comparator get_collation(java.lang.String uri)

Parameters

uri

Returns

java.util.Comparator


get_doc

public org.eclipse.wst.xml.xpath2.processor.ResultSequence get_doc(java.net.URI resolved)

get document

Parameters

resolved

Returns

org.eclipse.wst.xml.xpath2.processor.ResultSequence - a ResultSequence from ResultSequenceFactory.create_new()


get_variable

public java.lang.Object get_variable(org.eclipse.wst.xml.xpath2.processor.internal.types.QName name)

Retrieve the variable name

Parameters

name

Returns

java.lang.Object - an AnyType result from get_var(name) or return NULL


getTypeModel

public org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel getTypeModel(org.w3c.dom.Node node)

Parameters

node

Returns

org.eclipse.wst.xml.xpath2.api.typesystem.TypeModel


last

public int last()

Retrieve the position of the last focus

Returns

int - an integer result from _focus.last()


node_position

public int node_position(org.w3c.dom.Node node)

Use focus().position() to retrieve the value.

Parameters

node

Returns

int


resolve_uri

public java.net.URI resolve_uri(java.lang.String uri)

Parameters

uri

Returns

java.net.URI


set_collation_provider

public void set_collation_provider(org.eclipse.wst.xml.xpath2.processor.CollationProvider provider)

Parameters

provider


set_default_collation

public void set_default_collation(java.lang.String _default_collation)

Parameters

_default_collation


set_focus

public void set_focus(org.eclipse.wst.xml.xpath2.processor.internal.Focus f)

Changes the current focus.

Parameters

f - focus to set


set_variable

public void set_variable(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var , org.eclipse.wst.xml.xpath2.processor.internal.types.AnyType val)

Sets the value of a variable.

Parameters

var - Variable name.

val - Variable value.


set_variable

public void set_variable(org.eclipse.wst.xml.xpath2.processor.internal.types.QName var , org.eclipse.wst.xml.xpath2.processor.ResultSequence val)

Parameters

var

val


tz

public org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration tz()

Reads the day from a TimeDuration type

Returns

org.eclipse.wst.xml.xpath2.processor.internal.types.XSDuration - an xs:integer _tz