public class ClassAwareMapContext
extends org.apache.commons.jexl2.MapContext
ClassAwareMapContext
is a JEXL MapContext
that
can resolve class names using Class.forName
for the purposes
of allowing access to built-in Java methods, especially static methods such
as java.lang.String.format
.Constructor | Description |
---|---|
ClassAwareMapContext() |
Constructs a
ClassAwareMapContext that uses an automatically
allocated, empty Map . |
ClassAwareMapContext(java.util.Map<java.lang.String,java.lang.Object> beans) |
Constructs a
ClassAwareMapContext that wraps the existing
Map of bean names to bean values. |
Modifier and Type | Method | Description |
---|---|---|
java.lang.Object |
get(java.lang.String name) |
Retrieves the variable value, or the
Class object, by name
as defined in this context. |
boolean |
has(java.lang.String name) |
Checks whether the name is a variable defined in this context, or if it
is a valid Java class name as determined by
Class.forName . |
public ClassAwareMapContext()
ClassAwareMapContext
that uses an automatically
allocated, empty Map
.public ClassAwareMapContext(java.util.Map<java.lang.String,java.lang.Object> beans)
ClassAwareMapContext
that wraps the existing
Map
of bean names to bean values.beans
- A Map
of bean names to bean values.public boolean has(java.lang.String name)
Class.forName
.has
in class org.apache.commons.jexl2.MapContext
name
- The variable's or class's name.true
if the name exists, otherwise
false
.public java.lang.Object get(java.lang.String name)
Class
object, by name
as defined in this context.get
in class org.apache.commons.jexl2.MapContext
name
- The variable's name or class's name.Class
object.Copyright © 2012–2018 Jett Team. All rights reserved.