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

public Class ObjectContext<T>

extends Object
implements JexlContext
Class Inheritance
All Implemented Interfaces
org.apache.commons.jexl2.JexlContext
Type Parameters
<T>
the wrapped object type to use

Wraps an Object as a Jexl context.
Since
2.1

Field Summary

Modifier and TypeField and Description
private final JexlEngine
jexl

The property solving jexl engine.

private final T
object

The object serving as context provider.

Constructor Summary

AccessConstructor and Description
public
ObjectContext(JexlEngine
the jexl engine to use to solve properties
engine
,
T
the object to wrap in this context
wrapped
)

Creates a new ObjectContext.

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

jexlback to summary
private final JexlEngine jexl

The property solving jexl engine.

objectback to summary
private final T object

The object serving as context provider.

Constructor Detail

ObjectContextback to summary
public ObjectContext(JexlEngine engine, T wrapped)

Creates a new ObjectContext.

Parameters
engine:JexlEngine

the jexl engine to use to solve properties

wrapped:T

the object to wrap in this context

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