Interface Variables

All Superinterfaces:
Serializable
All Known Implementing Classes:
BasicVariables, KeywordVariables

public interface Variables extends Serializable
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()
Version:
$Revision: 652925 $ $Date: 2008-05-02 17:05:41 -0500 (Fri, 02 May 2008) $
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    declareVariable(String varName, Object value)
    Defines a new variable with the specified value or modifies the value of an existing variable.
    Returns the value of the specified variable.
    boolean
    Returns true if the specified variable is declared.
    void
    Removes an existing variable.
  • Method Details

    • isDeclaredVariable

      boolean isDeclaredVariable(String varName)
      Returns true if the specified variable is declared.
      Parameters:
      varName - variable name
      Returns:
      boolean
    • getVariable

      Object getVariable(String varName)
      Returns the value of the specified variable.
      Parameters:
      varName - variable name
      Returns:
      Object value
      Throws:
      IllegalArgumentException - if there is no such variable.
    • declareVariable

      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.
      Parameters:
      varName - variable name
      value - to declare
    • undeclareVariable

      void undeclareVariable(String varName)
      Removes an existing variable. May throw UnsupportedOperationException.
      Parameters:
      varName - is a variable name without the "$" sign