org.apache.commons.jxpath
Interface Variables
- BasicVariables, KeywordVariables
public interface Variables
Variables provide access to a global set of values accessible via XPath.
XPath can reference variables using the
"$varname"
syntax.
To use a custom implementation of this interface, pass it to
JXPathContext.setVariables()
$Revision: 1.6 $ $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 specified variable.
|
boolean | isDeclaredVariable(String varName) - Returns true if the specified variable is declared.
|
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.
May throw UnsupportedOperationException.
getVariable
public Object getVariable(String varName)
Returns the value of the specified variable.
Throws IllegalArgumentException if there is no such variable.
isDeclaredVariable
public boolean isDeclaredVariable(String varName)
Returns true if the specified variable is declared.
undeclareVariable
public void undeclareVariable(String varName)
Removes an existing variable. May throw UnsupportedOperationException.
varName
- is a variable name without the "$" sign