public class ELContext extends Object implements org.apache.commons.jexl3.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".
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 | Class and Description |
|---|---|
static class |
ELContext.Context
Context object passed to every expression evaluation.
|
| Constructor and Description |
|---|
ELContext()
No-op constructors that does nothing but create a instance of context.
|
ELContext(ExecutorContext context)
Constructor that extracts the
ExecutorContext internals and turns them into variables. |
ELContext(ExecutorContext context,
EL el,
Row row)
Sets the context for EL, includes the required variables in expression, 'this' and 'ctx'.
|
ELContext(Map<String,Object> values)
This constructor provides the pre-defined values for JEXL expression.
|
ELContext(String name,
Object object)
This constructor sets the expression context with a variable.
|
| Modifier and Type | Method and Description |
|---|---|
ELContext |
add(String name,
Object value)
d
Sets a variable with the value.
|
Object |
get(String name)
Returns the object associated with the name if found, else it's null.
|
boolean |
has(String name)
Checks if a variable exists in the context.
|
void |
set(String name,
Object value)
Sets a variable with the value.
|
public ELContext()
public ELContext(ExecutorContext context)
ExecutorContext internals and turns them into variables.
This method extracts the transient variables, runtime arguments, environment it's running in and
the context in which it is running as identifiers that can be used within JEXL expression.context - to be examined to be extracted into JEXL expression variables.public ELContext(ExecutorContext context, EL el, Row row)
context - to be examined to be extracted into JEXL expression variables.el - the expression.row - the row for 'this'.public ELContext(String name, Object object)
name - of the variable.object - the object associated with the variable.public Object get(String name)
get in interface org.apache.commons.jexl3.JexlContextname - of the variable.public void set(String name, Object value)
set in interface org.apache.commons.jexl3.JexlContextname - of the variable.value - of the variable.public ELContext add(String name, Object value)
name - of the variable.value - of the variable.public boolean has(String name)
has in interface org.apache.commons.jexl3.JexlContextname - of the variable to be checked.Copyright © 2022 CDAP Licensed under the Apache License, Version 2.0.