org.jaxen
public class Context extends Object implements Serializable
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.
See Also: ContextSupport BaseXPath XPath for dom4j
XPath for JDOM
XPath for W3C DOM
Field Summary | |
---|---|
ContextSupport | contextSupport Context-support |
List | nodeSet Context node-set |
int | position Current context position |
static long | serialVersionUID |
int | size Current context size |
Constructor Summary | |
---|---|
Context(ContextSupport contextSupport) Create a new context.
|
Method Summary | |
---|---|
Context | duplicate() Create a type-safe shallow copy.
|
ContextSupport | getContextSupport() Retrieve the ContextSupport .
|
Function | getFunction(String namespaceURI, String prefix, String localName) Retrieve a Function .
|
Navigator | getNavigator() Retrieve the current Navigator .
|
List | getNodeSet() Retrieve the context node-set.
|
int | getPosition() Retrieve current position in the context node-set.
|
int | getSize() Retrieve the size of the current context node-set.
|
Object | getVariableValue(String namespaceURI, String prefix, String localName) Retrieve a variable value.
|
void | setContextSupport(ContextSupport contextSupport) Set the ContextSupport .
|
void | setNodeSet(List nodeSet) Set the context node-set, and sets the current context size to the size of this node-set. |
void | setPosition(int position) Set the current position in the context node-set.
|
void | setSize(int size) Set the current size in the context node-set.
|
String | translateNamespacePrefixToUri(String prefix) Translate a namespace prefix to its URI.
|
Parameters: contextSupport the context-support
Returns: the duplicate
ContextSupport
.
Returns: the context-support
Function
.
Parameters: namespaceURI the function namespace URI prefix the function prefix localName the function name
Returns: the function object
Throws: UnresolvableException if unable to locate a bound function
Navigator
.
Returns: the navigator
Returns: the context node-set
Returns: the current position
Returns: the size
Parameters: namespaceURI the function namespace URI prefix the function prefix localName the function name
Returns: the variable value
Throws: UnresolvableException if unable to locate a bound variable
ContextSupport
.
Parameters: contextSupport the context-support
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
.
Parameters: nodeSet the context node-set
Parameters: position the position
Parameters: size the size
Parameters: prefix the prefix
Returns: the namespace URI mapped to the prefix