Class ReflectiveELProxyFactory
java.lang.Object
io.micronaut.el.interpreter.reflection.ReflectiveELProxyFactory
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> TImplements the functional interface with the lambda expression.booleanisFunctionalInterface(Class<?> type) Whether the given type is a functional interface this factory can implement.
-
Constructor Details
-
ReflectiveELProxyFactory
public ReflectiveELProxyFactory()
-
-
Method Details
-
isFunctionalInterface
Description copied from interface:ELProxyFactoryWhether the given type is a functional interface this factory can implement.- Specified by:
isFunctionalInterfacein interfaceELProxyFactory- 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:ELProxyFactoryImplements the functional interface with the lambda expression.- Specified by:
createin interfaceELProxyFactory- Type Parameters:
T- The functional interface- Parameters:
context- The context, ornullwhen the lambda carries its ownlambda- The lambda expressiontype- The functional interface- Returns:
- The instance
-