Top Description Fields Constructors Methods
org.apache.commons.jexl2

public Class MapContext

extends Object
implements JexlContext
Class Inheritance
All Implemented Interfaces
org.apache.commons.jexl2.JexlContext
Imports
java.util.HashMap, .Map

Wraps a map in a context.

Each entry in the map is considered a variable name, value pair.

Field Summary

Modifier and TypeField and Description
protected final Map<String, Object>
map

The wrapped variable map.

Constructor Summary

AccessConstructor and Description
public
MapContext()

Creates a MapContext on an automatically allocated underlying HashMap.

public
MapContext(Map<String, Object>
the variable map
vars
)

Creates a MapContext wrapping an existing user provided map.

Method Summary

Modifier and TypeMethod and Description
public Object
get(String
the variable's name
name
)

Implements org.apache.commons.jexl2.JexlContext.get.

Gets the value of a variable.
public boolean
has(String
the variable's name
name
)

Implements org.apache.commons.jexl2.JexlContext.has.

Checks whether a variable is defined in this context.
public void
set(String
the variable's name
name
,
Object
the variable's value
value
)

Implements org.apache.commons.jexl2.JexlContext.set.

Sets the value of a variable.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

mapback to summary
protected final Map<String, Object> map

The wrapped variable map.

Constructor Detail

MapContextback to summary
public MapContext()

Creates a MapContext on an automatically allocated underlying HashMap.

MapContextback to summary
public MapContext(Map<String, Object> vars)

Creates a MapContext wrapping an existing user provided map.

Parameters
vars:Map<String, Object>

the variable map

Method Detail

getback to summary
public Object get(String name)

Implements org.apache.commons.jexl2.JexlContext.get.

Doc from org.apache.commons.jexl2.JexlContext.get.

Gets the value of a variable.

Parameters
name:String

the variable's name

Returns:Object

the value

hasback to summary
public boolean has(String name)

Implements org.apache.commons.jexl2.JexlContext.has.

Doc from org.apache.commons.jexl2.JexlContext.has.

Checks whether a variable is defined in this context.

A variable may be defined with a null value; this method checks whether the value is null or if the variable is undefined.

Parameters
name:String

the variable's name

Returns:boolean

true if it exists, false otherwise

setback to summary
public void set(String name, Object value)

Implements org.apache.commons.jexl2.JexlContext.set.

Doc from org.apache.commons.jexl2.JexlContext.set.

Sets the value of a variable.

Parameters
name:String

the variable's name

value:Object

the variable's value