Package org.apache.commons.jxpath
Interface Variables
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
BasicVariables,KeywordVariables
public interface Variables extends java.io.SerializableVariables 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 toJXPathContext.setVariables()- Version:
- $Revision: 652925 $ $Date: 2008-05-02 17:05:41 -0500 (Fri, 02 May 2008) $
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeclareVariable(java.lang.String varName, java.lang.Object value)Defines a new variable with the specified value or modifies the value of an existing variable.java.lang.ObjectgetVariable(java.lang.String varName)Returns the value of the specified variable.booleanisDeclaredVariable(java.lang.String varName)Returns true if the specified variable is declared.voidundeclareVariable(java.lang.String varName)Removes an existing variable.
-
-
-
Method Detail
-
isDeclaredVariable
boolean isDeclaredVariable(java.lang.String varName)
Returns true if the specified variable is declared.- Parameters:
varName- variable name- Returns:
- boolean
-
getVariable
java.lang.Object getVariable(java.lang.String varName)
Returns the value of the specified variable.- Parameters:
varName- variable name- Returns:
- Object value
- Throws:
java.lang.IllegalArgumentException- if there is no such variable.
-
declareVariable
void declareVariable(java.lang.String varName, java.lang.Object value)Defines a new variable with the specified value or modifies the value of an existing variable. May throw UnsupportedOperationException.- Parameters:
varName- variable namevalue- to declare
-
undeclareVariable
void undeclareVariable(java.lang.String varName)
Removes an existing variable. May throw UnsupportedOperationException.- Parameters:
varName- is a variable name without the "$" sign
-
-