Top Description Methods
org.apache.commons.jexl2

public Interface JexlContext

Known Direct Implementers
org.apache.commons.jexl2.MapContext, org.apache.commons.jexl2.ObjectContext, org.apache.commons.jexl2.ReadonlyContext, org.apache.commons.jexl2.UnifiedJEXL.TemplateContext, org.apache.commons.jexl2.scripting.JexlScriptEngine.JexlContextWrapper

Manages variables which can be referenced in a JEXL expression.

Note that JEXL may use '$jexl' and '$ujexl' variables for internal purpose; setting or getting those variables may lead to unexpected results unless specified otherwise.

Since
1.0
Version
$Id: JexlContext.java 1202769 2011-11-16 16:33:02Z henrib $

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

the value
get
(String
the variable's name
name
)

Gets the value of a variable.

public boolean

Returns:

true if it exists, false otherwise
has
(String
the variable's name
name
)

Checks whether a variable is defined in this context.

public void
set(String
the variable's name
name
,
Object
the variable's value
value
)

Sets the value of a variable.

Method Detail

getback to summary
public Object get(String name)

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)

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)

Sets the value of a variable.

Parameters
name:String

the variable's name

value:Object

the variable's value