public interface JexlContext
JEXL variable names in their simplest form are 'java-like' identifiers. JEXL also considers 'ant' inspired variables expressions as valid. For instance, the expression 'x.y.z' is an 'antish' variable and will be resolved as a whole by the context, i.e. using the key "x.y.z". This proves to be useful to solve "fully qualified class names".
The interpreter variable resolution algorithm will try the different sequences of identifiers till it finds one that exists in the context; if "x" is an object known in the context (JexlContext.has("x") returns true), "x.y" will not be looked up in the context but will most likely refer to "x.getY()".
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.
| Modifier and Type | Interface and Description | 
|---|---|
| static interface  | JexlContext.AnnotationProcessorA marker interface of the JexlContext that processes annotations. | 
| static interface  | JexlContext.CancellationHandleA marker interface of the JexlContext sharing a cancelling flag. | 
| static interface  | JexlContext.NamespaceFunctorA marker interface of the JexlContext, NamespaceFunctor allows creating an instance
 to delegate namespace methods calls to. | 
| static interface  | JexlContext.NamespaceResolverA marker interface of the JexlContext that declares how to resolve a namespace from its name;
 it is used by the interpreter during evaluation. | 
| static interface  | JexlContext.OptionsHandleA marker interface of the JexlContext that exposes runtime evaluation options. | 
| static interface  | JexlContext.PragmaProcessorA marker interface of the JexlContext that processes pragmas. | 
| static interface  | JexlContext.ThreadLocalA marker interface  of the JexlContext that indicates the interpreter to put this context
 in the JexlEngine thread local context instance during evaluation. | 
| Modifier and Type | Method and Description | 
|---|---|
| Object | get(String name)Gets the value of a variable. | 
| boolean | has(String name)Checks whether a variable is defined in this context. | 
| void | set(String name,
   Object value)Sets the value of a variable. | 
Object get(String name)
name - the variable's namevoid set(String name, Object value)
name - the variable's namevalue - the variable's valueboolean has(String name)
A variable may be defined with a null value; this method checks whether the value is null or if the variable is undefined.
name - the variable's nameCopyright © 2001–2021 The Apache Software Foundation. All rights reserved.