Class ELLambdas
java.lang.Object
io.micronaut.el.runtime.ELLambdas
The factory of the lambda expressions created by the expressions generated at compilation time.
- Since:
- 1.0
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable Objectstatic jakarta.el.LambdaExpressioncreate(jakarta.el.ELContext context, List<String> formalParameters, Function<jakarta.el.ELContext, @Nullable Object> body) Creates a lambda expression described in the section 1.20 of the specification, whose body is evaluated with the arguments in the lambda scope of the context.static voidDiscards the result of the body of a lambda expression implementing a functional interface whose method returns nothing.static jakarta.el.LambdaExpressionlambda(jakarta.el.ELContext context, String[] formalParameters, ELLambdaBody body) Creates a lambda expression with any number of parameters from its compiled body.static jakarta.el.LambdaExpressionlambda0(jakarta.el.ELContext context, ELLambdaBody.Nullary body) Creates a lambda expression without parameters from its compiled body.static jakarta.el.LambdaExpressionlambda1(jakarta.el.ELContext context, String first, ELLambdaBody.Unary body) Creates a lambda expression with one parameter from its compiled body.static jakarta.el.LambdaExpressionlambda2(jakarta.el.ELContext context, String first, String second, ELLambdaBody.Binary body) Creates a lambda expression with two parameters from its compiled body.static jakarta.el.LambdaExpressionlambda3(jakarta.el.ELContext context, String first, String second, String third, ELLambdaBody.Ternary body) Creates a lambda expression with three parameters from its compiled body.
-
Method Details
-
create
public static jakarta.el.LambdaExpression create(jakarta.el.ELContext context, List<String> formalParameters, Function<jakarta.el.ELContext, @Nullable Object> body) Creates a lambda expression described in the section 1.20 of the specification, whose body is evaluated with the arguments in the lambda scope of the context. This is the form of the interpreter.- Parameters:
context- The contextformalParameters- The formal parametersbody- The body, reading the arguments from the context- Returns:
- The lambda expression
-
lambda0
public static jakarta.el.LambdaExpression lambda0(jakarta.el.ELContext context, ELLambdaBody.Nullary body) Creates a lambda expression without parameters from its compiled body.- Parameters:
context- The contextbody- The compiled body- Returns:
- The lambda expression
-
lambda1
public static jakarta.el.LambdaExpression lambda1(jakarta.el.ELContext context, String first, ELLambdaBody.Unary body) Creates a lambda expression with one parameter from its compiled body.- Parameters:
context- The contextfirst- The name of the parameterbody- The compiled body- Returns:
- The lambda expression
-
lambda2
public static jakarta.el.LambdaExpression lambda2(jakarta.el.ELContext context, String first, String second, ELLambdaBody.Binary body) Creates a lambda expression with two parameters from its compiled body.- Parameters:
context- The contextfirst- The name of the first parametersecond- The name of the second parameterbody- The compiled body- Returns:
- The lambda expression
-
lambda3
public static jakarta.el.LambdaExpression lambda3(jakarta.el.ELContext context, String first, String second, String third, ELLambdaBody.Ternary body) Creates a lambda expression with three parameters from its compiled body.- Parameters:
context- The contextfirst- The name of the first parametersecond- The name of the second parameterthird- The name of the third parameterbody- The compiled body- Returns:
- The lambda expression
-
lambda
public static jakarta.el.LambdaExpression lambda(jakarta.el.ELContext context, String[] formalParameters, ELLambdaBody body) Creates a lambda expression with any number of parameters from its compiled body. The names are passed as an array, a generic list has a descriptor the source and the bytecode writers do not infer alike.- Parameters:
context- The contextformalParameters- The formal parametersbody- The compiled body- Returns:
- The lambda expression
-
discard
Discards the result of the body of a lambda expression implementing a functional interface whose method returns nothing.- Parameters:
ignored- The result
-
argument
-