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) $
    Author:
    Dmitri Plotnikov
    • Method Detail

      • 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