Class BasicVariables
java.lang.Object
org.apache.commons.jxpath.BasicVariables
- All Implemented Interfaces:
Serializable, Variables
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final longprivate HashMapContains the values of declared variables -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddeclareVariable(String varName, Object value) Defines a new variable with the specified value or modifies the value of an existing variable.getVariable(String varName) Returns the value of the variable if it is defined, otherwise, throws IllegalArgumentExceptionbooleanisDeclaredVariable(String varName) Returns true if the variable has been defined, even if the value of the variable is null.toString()voidundeclareVariable(String varName) Removes an existing variable.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
vars
Contains the values of declared variables
-
-
Constructor Details
-
BasicVariables
public BasicVariables()
-
-
Method Details
-
isDeclaredVariable
Returns true if the variable has been defined, even if the value of the variable is null.- Specified by:
isDeclaredVariablein interfaceVariables- Parameters:
varName- is a variable name without the "$" sign- Returns:
- true if the variable is declared
-
getVariable
Returns the value of the variable if it is defined, otherwise, throws IllegalArgumentException- Specified by:
getVariablein interfaceVariables- Parameters:
varName- is a variable name without the "$" sign- Returns:
- the value of the variable
-
declareVariable
Defines a new variable with the specified value or modifies the value of an existing variable.- Specified by:
declareVariablein interfaceVariables- Parameters:
varName- is a variable name without the "$" signvalue- is the new value for the variable, which can be null
-
undeclareVariable
Removes an existing variable. May throw UnsupportedOperationException.- Specified by:
undeclareVariablein interfaceVariables- Parameters:
varName- is a variable name without the "$" sign
-
toString
-