Class ScopedVariableSet
java.lang.Object
org.exolab.adaptx.xslt.util.ScopedVariableSet
A simple stack for VariableSets
- Version:
- $Revision: 3633 $ $Date: 2003-03-01 08:38:44 +0100 (Sat, 01 Mar 2003) $
- Author:
- Keith Visco
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new ScopedVariableSetScopedVariableSet(int size) Creates a new ScopedVariableSet using the givin size -
Method Summary
Modifier and TypeMethodDescriptionvoidadd()adds a new VariableSet, which is then set as the current scope.current()Returns the VariableSet currently in scope.getVariable(String name) Returns the value of a variable.voidremove()Removes the current VariableSet scope.voidsetVariable(String name, XPathResult value) Binds the XPath result to the variable name.
-
Field Details
-
DEFAULT_SIZE
public static final int DEFAULT_SIZEThe default size.- See Also:
-
-
Constructor Details
-
ScopedVariableSet
public ScopedVariableSet()Creates a new ScopedVariableSet -
ScopedVariableSet
public ScopedVariableSet(int size) Creates a new ScopedVariableSet using the givin size- Parameters:
size- the number of VariableSet objects to pre-initialize. This must be a non-negative integer.
-
-
Method Details
-
current
Returns the VariableSet currently in scope.- Returns:
- the VariableSet currently in scope.
-
getVariable
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.- Parameters:
name- The variable name- Returns:
- The variable's value as an XPath result, or null
-
setVariable
Binds the XPath result to the variable name. The result will be returned from subsequent call togetVariable(String)using the same variable name.- Parameters:
name- The variable namevalue- The variable's value
-
remove
public void remove()Removes the current VariableSet scope. -
add
public void add()adds a new VariableSet, which is then set as the current scope.
-