org.apache.commons.jexl.context
Class HashMapContext

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjava.util.HashMap
          extended byorg.apache.commons.jexl.context.HashMapContext
All Implemented Interfaces:
java.lang.Cloneable, JexlContext, java.util.Map, java.io.Serializable

public class HashMapContext
extends java.util.HashMap
implements JexlContext

Implementation of JexlContext based on a HashMap

Version:
$Id: HashMapContext.java,v 1.4 2004/08/23 13:51:59 dion Exp $
Author:
Geir Magnusson Jr.
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class java.util.HashMap
 
Nested classes inherited from class java.util.AbstractMap
 
Field Summary
 
Fields inherited from class java.util.HashMap
 
Fields inherited from class java.util.AbstractMap
 
Constructor Summary
HashMapContext()
           
 
Method Summary
 java.util.Map getVars()
          Retrives the Map of variables associated with this JexlContext.
 void setVars(java.util.Map vars)
          Replaces variables in a JexlContext with the variables contained in the supplied Map.
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

HashMapContext

public HashMapContext()
Method Detail

setVars

public void setVars(java.util.Map vars)
Description copied from interface: JexlContext
Replaces variables in a JexlContext with the variables contained in the supplied Map. When setVars() is called on a JexlContext, it clears the current Map and puts each entry of the supplied Map into the current variable Map.

Specified by:
setVars in interface JexlContext
Parameters:
vars - Contents of vars will be replaced with the content of this Map

getVars

public java.util.Map getVars()
Description copied from interface: JexlContext
Retrives the Map of variables associated with this JexlContext. The keys of this map correspond to variable names referenced in a JEXL expression.

Specified by:
getVars in interface JexlContext
Returns:
A reference to the variable Map associated with this JexlContext.