Encapsulates a parameterized ValueExpression.
A LambdaExpression is a representation of the EL Lambda
expression syntax. It consists of a list of the formal parameters and a
body, represented by a ValueExpression.
The body can be any valid Expression, including another
LambdaExpression.
LambdaExpression is created when an EL expression containing
a Lambda expression is evaluated.
A LambdaExpression can be invoked by calling
LambdaExpression#invoke, with
an javax.el.ELContext and a list of the actual arguments.
Alternately, a LambdaExpression can be invoked without passing
a ELContext, in which case the ELContext previously
set by calling LambdaExpression#setELContext will be used.
The evaluation of the ValueExpression in the body uses the
ELContext to resolve references to the parameters, and to evaluate
the lambda expression.
The result of the evaluation is returned.
ELContext#getLambdaArgument, ELContext#enterLambdaScope, ELContext#exitLambdaScope
| Modifier and Type | Field and Description |
|---|---|
| private ELContext | |
| private Map | |
| private ValueExpression | |
| private List |
| Access | Constructor and Description |
|---|---|
| public | LambdaExpression(List<String>
The list of String representing the formal
parameters. formalParameters, ValueExpression The expression)ValueExpression representing the
body.Creates a new LambdaExpression. |
| Modifier and Type | Method and Description |
|---|---|
| public Object | Returns: The result of invoking the Lambda expressionThe ELContext used for the evaluation of the expression
The ELContext set by elContext, Object... setELContext is ignored.The arguments to invoke the Lambda expression. For calls with
no arguments, an empty array must be provided. A Lambda argument
can be args)null.Invoke the encapsulated Lambda expression. |
| public Object | |
| public void | setELContext(ELContext
The ELContext to use in evaluating the LambdaExpression. context)Set the ELContext to use in evaluating the LambdaExpression. |
| context | back to summary |
|---|---|
| private ELContext context | |
| envirArgs | back to summary |
|---|---|
| private Map<String, Object> envirArgs | |
| expression | back to summary |
|---|---|
| private ValueExpression expression | |
| formalParameters | back to summary |
|---|---|
| private List<String> formalParameters | |
| LambdaExpression | back to summary |
|---|---|
| public LambdaExpression(List<String> formalParameters, ValueExpression expression) Creates a new LambdaExpression.
| |
| invoke | back to summary |
|---|---|
| public Object invoke(ELContext elContext, Object... args) throws ELException Invoke the encapsulated Lambda expression. The supplied arguments are matched, in
the same order, to the formal parameters. If there are more arguments
than the formal parameters, the extra arguments are ignored. If there
are less arguments than the formal parameters, an
The actual Lambda arguments are added to the ELContext and are available during the evaluation of the Lambda expression. They are removed after the evaluation.
| |
| invoke | back to summary |
|---|---|
| public Object invoke(Object... args) Invoke the encapsulated Lambda expression. The supplied arguments are matched, in
the same order, to the formal parameters. If there are more arguments
than the formal parameters, the extra arguments are ignored. If there
are less arguments than the formal parameters, an
The actual Lambda arguments are added to the ELContext and are available during the evaluation of the Lambda expression. They are removed after the evaluation. The ELContext set byLambdaExpression#setELContext is used in
the evaluation of the lambda Expression.
| |
| setELContext | back to summary |
|---|---|
| public void setELContext(ELContext context) Set the ELContext to use in evaluating the LambdaExpression.
The ELContext must to be set prior to the invocation of the LambdaExpression,
unless it is supplied with
| |