org.exolab.adaptx.xpath
Class VariableSetImpl

java.lang.Object
  extended by org.exolab.adaptx.xpath.VariableSet
      extended by org.exolab.adaptx.xpath.VariableSetImpl
All Implemented Interfaces:
java.io.Serializable

public final class VariableSetImpl
extends VariableSet

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:
$Revision: 3633 $
Author:
Assaf Arkin, Keith Visco
See Also:
XPathResult, XPathExpression, Serialized Form

Constructor Summary
VariableSetImpl()
          Constructs a new empty set of variable bindings.
VariableSetImpl(VariableSet parent)
          Constructs a new empty variable binding with reference to a parent variable binding.
 
Method Summary
 void clear()
          Removes the current variable bindings from this VariableSet
 XPathResult getVariable(java.lang.String name)
          Returns the value of a variable.
 void setVariable(java.lang.String name, XPathResult value)
          Binds the XPath result to the variable name.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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.

Parameters:
parent - The parent variable binding (may be null)
Method Detail

clear

public void clear()
Removes the current variable bindings from this VariableSet


getVariable

public XPathResult getVariable(java.lang.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.

Specified by:
getVariable in class VariableSet
Parameters:
name - The variable name
Returns:
The variable's value as an XPath result, or null

setVariable

public void setVariable(java.lang.String name,
                        XPathResult value)
Binds the XPath result to the variable name. The result will be returned from subsequent call to getVariable(java.lang.String) using the same variable name.

Parameters:
name - The variable name
value - The variable's value