Class ELLambdas

java.lang.Object
io.micronaut.el.runtime.ELLambdas

@Internal public final class ELLambdas extends Object
The factory of the lambda expressions created by the expressions generated at compilation time.
Since:
1.0
Author:
Denis Stepanov
  • Method Summary

    Modifier and Type
    Method
    Description
    static @Nullable Object
    argument(@Nullable Object[] arguments, int index)
     
    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.
    static void
    discard(@Nullable Object ignored)
    Discards the result of the body of a lambda expression implementing a functional interface whose method returns nothing.
    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.
    static jakarta.el.LambdaExpression
    lambda0(jakarta.el.ELContext context, ELLambdaBody.Nullary body)
    Creates a lambda expression without parameters from its compiled body.
    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.
    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.
    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.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 context
      formalParameters - The formal parameters
      body - 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 context
      body - 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 context
      first - The name of the parameter
      body - 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 context
      first - The name of the first parameter
      second - The name of the second parameter
      body - 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 context
      first - The name of the first parameter
      second - The name of the second parameter
      third - The name of the third parameter
      body - 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 context
      formalParameters - The formal parameters
      body - The compiled body
      Returns:
      The lambda expression
    • discard

      public static void discard(@Nullable Object ignored)
      Discards the result of the body of a lambda expression implementing a functional interface whose method returns nothing.
      Parameters:
      ignored - The result
    • argument

      public static @Nullable Object argument(@Nullable Object[] arguments, int index)
      Parameters:
      arguments - The arguments of a lambda expression
      index - The index of a parameter
      Returns:
      The argument