Class ExpressionImpl
java.lang.Object
edu.internet2.middleware.grouperClientExt.org.apache.commons.jexl2.ExpressionImpl
- All Implemented Interfaces:
Expression
,Script
Instances of ExpressionImpl are created by the
JexlEngine
,
and this is the default implementation of the Expression
and
Script
interface.- Since:
- 1.0
-
Field Summary
Modifier and TypeFieldDescriptionprotected final String
Original expression stripped from leading & trailing spaces.protected final JexlEngine
The engine for this expression.protected final ASTJexlScript
The resulting AST we can interpret. -
Constructor Summary
ModifierConstructorDescriptionprotected
ExpressionImpl
(JexlEngine engine, String expr, ASTJexlScript ref) Do not let this be generally instantiated with a 'new'. -
Method Summary
Modifier and TypeMethodDescriptioncallable
(JexlContext context) Creates a Callable from this script.callable
(JexlContext context, Object... args) Creates a Callable from this script.dump()
Returns the JEXL expression by reconstructing it from the parsed tree.evaluate
(JexlContext context) Evaluates the expression with the variables contained in the suppliedJexlContext
.execute
(JexlContext context) Executes the script with the variables contained in the suppliedJexlContext
.execute
(JexlContext context, Object... args) Executes the script with the variables contained in the suppliedJexlContext
and a set of arguments corresponding to the parameters used during parsing.Returns the JEXL expression this Expression was created with.String[]
Gets this script local variables.String[]
Gets this script parameters.getText()
Returns the text of this Script.Gets this script variables.toString()
Provide a string representation of this expression.
-
Field Details
-
jexl
The engine for this expression. -
expression
Original expression stripped from leading & trailing spaces. -
script
The resulting AST we can interpret.
-
-
Constructor Details
-
ExpressionImpl
Do not let this be generally instantiated with a 'new'.- Parameters:
engine
- the interpreter to evaluate the expressionexpr
- the expression.ref
- the parsed expression.
-
-
Method Details
-
evaluate
Evaluates the expression with the variables contained in the suppliedJexlContext
.- Specified by:
evaluate
in interfaceExpression
- Parameters:
context
- A JexlContext containing variables.- Returns:
- The result of this evaluation
-
dump
Returns the JEXL expression by reconstructing it from the parsed tree.- Specified by:
dump
in interfaceExpression
- Returns:
- the JEXL expression
-
getExpression
Returns the JEXL expression this Expression was created with.- Specified by:
getExpression
in interfaceExpression
- Returns:
- The JEXL expression to be evaluated
-
toString
Provide a string representation of this expression. -
getText
Returns the text of this Script. -
execute
Executes the script with the variables contained in the suppliedJexlContext
. -
execute
Executes the script with the variables contained in the suppliedJexlContext
and a set of arguments corresponding to the parameters used during parsing. -
getParameters
Gets this script parameters.- Specified by:
getParameters
in interfaceScript
- Returns:
- the parameters or null
- Since:
- 2.1
-
getLocalVariables
Gets this script local variables.- Specified by:
getLocalVariables
in interfaceScript
- Returns:
- the local variables or null
- Since:
- 2.1
-
getVariables
Gets this script variables.Note that since variables can be in an ant-ish form (ie foo.bar.quux), each variable is returned as a list of strings where each entry is a fragment of the variable ({"foo", "bar", "quux"} in the example.
- Specified by:
getVariables
in interfaceScript
- Returns:
- the variables or null
- Since:
- 2.1
-
callable
Creates a Callable from this script.This allows to submit it to an executor pool and provides support for asynchronous calls.
The interpreter will handle interruption/cancellation gracefully if needed.
-
callable
Creates a Callable from this script.This allows to submit it to an executor pool and provides support for asynchronous calls.
The interpreter will handle interruption/cancellation gracefully if needed.
-