org.apache.commons.jxpath
Class BasicVariables
java.lang.Object
org.apache.commons.jxpath.BasicVariables
- Variables
public class BasicVariables
extends java.lang.Object
A basic implementation of the Variables interface that uses a HashMap.
$Revision: 1.7 $ $Date: 2004/02/29 14:17:42 $ void | declareVariable(String varName, Object value) - Defines a new variable with the specified value or modifies
the value of an existing variable.
|
Object | getVariable(String varName) - Returns the value of the variable if it is defined,
otherwise, throws IllegalArgumentException
|
boolean | isDeclaredVariable(String varName) - Returns true if the variable has been defined, even if the
value of the variable is null.
|
String | toString()
|
void | undeclareVariable(String varName) - Removes an existing variable.
|
declareVariable
public void declareVariable(String varName,
Object value)
Defines a new variable with the specified value or modifies
the value of an existing variable.
- declareVariable in interface Variables
varName
- is a variable name without the "$" signvalue
- is the new value for the variable, which can be null
getVariable
public Object getVariable(String varName)
Returns the value of the variable if it is defined,
otherwise, throws IllegalArgumentException
- getVariable in interface Variables
varName
- is a variable name without the "$" sign
- the value of the variable
isDeclaredVariable
public boolean isDeclaredVariable(String varName)
Returns true if the variable has been defined, even if the
value of the variable is null.
- isDeclaredVariable in interface Variables
varName
- is a variable name without the "$" sign
- true if the variable is declared
toString
public String toString()
undeclareVariable
public void undeclareVariable(String varName)
Removes an existing variable. May throw UnsupportedOperationException.
- undeclareVariable in interface Variables
varName
- is a variable name without the "$" sign