Class ReflectiveELProxyFactory

java.lang.Object
io.micronaut.el.interpreter.reflection.ReflectiveELProxyFactory
All Implemented Interfaces:
ELProxyFactory

@Internal public final class ReflectiveELProxyFactory extends Object implements ELProxyFactory
Implements a functional interface nothing described in advance, by discovering its single abstract method and standing in for it with a Proxy.

This is the reflection the coercion of the section 1.23.2 needs when the interface is an application's own and the method taking it was selected at evaluation time, so nothing could name it earlier. It lives here because of that: without this module the coercion does not apply, and an application that wants it without reflection registers the interface with ELMethodRegistry.functionalInterface.

Since:
1.1
Author:
Denis Stepanov
  • Constructor Details

    • ReflectiveELProxyFactory

      public ReflectiveELProxyFactory()
  • Method Details

    • isFunctionalInterface

      public boolean isFunctionalInterface(Class<?> type)
      Description copied from interface: ELProxyFactory
      Whether the given type is a functional interface this factory can implement.
      Specified by:
      isFunctionalInterface in interface ELProxyFactory
      Parameters:
      type - The target type
      Returns:
      Whether the type is a functional interface
    • create

      public <T> T create(@Nullable jakarta.el.ELContext context, jakarta.el.LambdaExpression lambda, Class<T> type)
      Description copied from interface: ELProxyFactory
      Implements the functional interface with the lambda expression.
      Specified by:
      create in interface ELProxyFactory
      Type Parameters:
      T - The functional interface
      Parameters:
      context - The context, or null when the lambda carries its own
      lambda - The lambda expression
      type - The functional interface
      Returns:
      The instance