Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.commons.jxpath
Class BasicVariables

    java.lang.Object
      |
      +--org.apache.commons.jxpath.BasicVariables

All Implemented Interfaces:
  Variables

public class BasicVariables
extends java.lang.Object
implements Variables

A basic implementation of the Variables interface that uses a HashMap.

Version:
  $Revision: 1.5 $ $Date: 2003/03/11 00:59:11 $
Author:
  Dmitri Plotnikov

Constructor Summary
`BasicVariables()`

Method Summary
`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.
`java.lang.Object` | `getVariable(java.lang.String varName)` Returns the value of the variable if it is defined, otherwise, throws IllegalArgumentException
`boolean` | `isDeclaredVariable(java.lang.String varName)` Returns true if the variable has been defined, even if the value of the variable is null.
`java.lang.String` | `toString()`
`void` | `undeclareVariable(java.lang.String varName)` Removes an existing variable.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### BasicVariables

    public BasicVariables()

Method Detail

### isDeclaredVariable

    public boolean isDeclaredVariable(java.lang.String varName)

  Returns true if the variable has been defined, even if the value of the variable is null.
  Specified by:
    `isDeclaredVariable` in interface `Variables`
  Parameters:
    `varName` - is a variable name without the "$" sign
  Returns:
    true if the variable is declared

### getVariable

    public java.lang.Object getVariable(java.lang.String varName)

  Returns the value of the variable if it is defined, otherwise, throws IllegalArgumentException
  Specified by:
    `getVariable` in interface `Variables`
  Parameters:
    `varName` - is a variable name without the "$" sign
  Returns:
    the value of the variable

### declareVariable

    public 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.
  Specified by:
    `declareVariable` in interface `Variables`
  Parameters:
    `varName` - is a variable name without the "$" sign
    `value` - is the new value for the variable, which can be null

### undeclareVariable

    public void undeclareVariable(java.lang.String varName)

  Removes an existing variable. May throw UnsupportedOperationException.
  Specified by:
    `undeclareVariable` in interface `Variables`
  Parameters:
    `varName` - is a variable name without the "$" sign

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2003 Apache Software Foundation. All Rights Reserved.