org.jaxen
Class Context
- Serializable
public class Context
extends java.lang.Object
implements Serializable
Wrapper around implementation-specific objects used
as the context of an expression evaluation.
NOTE: This class is not typically used directly,
but is exposed for writers of implementation-specific
XPath packages.
The
Context
bundles utilities together
for evaluation of the expression. It wraps the provided
objects for ease-of-passage through the expression
AST.
nodeSet
private List nodeSet
Context node-set
position
private int position
Current context position
serialVersionUID
private static final long serialVersionUID
size
private int size
Current context size
Context
public Context(ContextSupport contextSupport)
Create a new context.
contextSupport
- the context-support
duplicate
public Context duplicate()
Create a type-safe shallow copy.
getContextSupport
public ContextSupport getContextSupport()
Retrieve the ContextSupport
.
getFunction
public Function getFunction(String namespaceURI,
String prefix,
String localName)
throws UnresolvableException
Retrieve a Function
.
namespaceURI
- the function namespace URIprefix
- the function prefixlocalName
- the function name
getNavigator
public Navigator getNavigator()
Retrieve the current Navigator
.
getNodeSet
public List getNodeSet()
Retrieve the context node-set.
This is a live list. It is not a copy.
Do not modify it.
getPosition
public int getPosition()
Retrieve current position in the context node-set.
getSize
public int getSize()
Retrieve the size of the current context node-set.
getVariableValue
public Object getVariableValue(String namespaceURI,
String prefix,
String localName)
throws UnresolvableException
Retrieve a variable value.
namespaceURI
- the function namespace URIprefix
- the function prefixlocalName
- the function name
setContextSupport
public void setContextSupport(ContextSupport contextSupport)
Set the ContextSupport
.
contextSupport
- the context-support
setNodeSet
public void setNodeSet(List nodeSet)
Set the context node-set, and sets the current context size to the size
of this node-set.
The actual list is stored in this object. A copy
is not made. This list should not be modified in other code after
calling this method.
After invoking this method, the client should immediately call
setSize
and
setPosition
.
nodeSet
- the context node-set
setPosition
public void setPosition(int position)
Set the current position in the context node-set.
setSize
public void setSize(int size)
Set the current size in the context node-set.
translateNamespacePrefixToUri
public String translateNamespacePrefixToUri(String prefix)
Translate a namespace prefix to its URI.
- the namespace URI mapped to the prefix