org.exolab.adaptx.xslt.util
Class ScopedVariableSet
java.lang.Object
org.exolab.adaptx.xslt.util.ScopedVariableSet
public final class ScopedVariableSet
extends java.lang.Object
A simple stack for VariableSets
$Revision: 3633 $ $Date: 2003-03-01 08:38:44 +0100 (Sat, 01 Mar 2003) $
DEFAULT_SIZE
public static final int DEFAULT_SIZE
The default size.
ScopedVariableSet
public ScopedVariableSet()
Creates a new ScopedVariableSet
ScopedVariableSet
public ScopedVariableSet(int size)
Creates a new ScopedVariableSet using the givin size
size
- the number of VariableSet objects to pre-initialize.
This must be a non-negative integer.
add
public void add()
adds a new VariableSet, which is then set as the current scope.
current
public VariableSet current()
Returns the VariableSet currently in scope.
- the VariableSet currently in scope.
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.
- The variable's value as an XPath result, or null
remove
public void remove()
Removes the current VariableSet scope.
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