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()
  • Method Details Link icon

    • declareVariable Link icon

      void declareVariable(String name, Object value)
      Defines a new variable with the specified value or modifies the value of an existing variable. May throw UnsupportedOperationException.
      Parameters:
      name - variable name
      value - to declare
    • getVariable Link icon

      Returns the value of the specified variable.
      Parameters:
      name - variable name
      Returns:
      Object value
      Throws:
      IllegalArgumentException - if there is no such variable.
    • isDeclaredVariable Link icon

      boolean isDeclaredVariable(String name)
      Returns true if the specified variable is declared.
      Parameters:
      name - variable name
      Returns:
      boolean
    • undeclareVariable Link icon

      Removes an existing variable. May throw UnsupportedOperationException.
      Parameters:
      name - is a variable name without the "$" sign