org.exolab.adaptx.xpath
Class VariableSetImpl
- java.io.Serializable
public final class VariableSetImpl
An implementation of VariableSet which is used to provide
variable bindings that can be used when evaluating
an XPath expression. Binds an unqualified variable name to an
XPath result.
Version:
- Assaf Arkin
- Keith Visco
XPathResult
, XPathExpression
, Serialized Form
VariableSetImpl
public VariableSetImpl()
Constructs a new empty set of variable bindings.
VariableSetImpl
public VariableSetImpl(VariableSet parent)
Constructs a new empty variable binding with reference to
a parent variable binding. Will use the parent variables to
obtain variables not added directory to this object.
parent
- The parent variable binding (may be null)
clear
public void clear()
Removes the current variable bindings from this VariableSet
getVariable
public XPathResult getVariable(String name)
Returns the value of a variable. Returns null if a variable
with this name was not found in this variable bindings, or any
parent variable binding.
- getVariable in interface VariableSet
name
- The variable name
- The variable's value as an XPath result, or null
setVariable
public void setVariable(String name,
XPathResult value)
Binds the XPath result to the variable name. The result will
be returned from subsequent call to
getVariable(String)
using
the same variable name.
name
- The variable namevalue
- The variable's value