Interface ELProxyFactory
- All Known Implementing Classes:
ReflectiveELProxyFactory
The coercion needs the single abstract method of the target interface. The functional interfaces of the
platform are implemented by this module directly, and an application declares its own to
ELMethodRegistry.functionalInterface(Class, ELMethodRegistry.Lambda), so neither reaches here. What does is an interface no one
named, which can only be implemented by discovering its method at runtime: that is reflection, so it is
contributed by the interpreter-reflection module rather than performed here.
An application implements ELMethodContributor rather than this. Without a factory on the
classpath the coercion does not apply, and a lambda expression reaching a parameter of an undescribed
functional interface type is reported as a failed coercion.
- Since:
- 1.1
- Author:
- Denis Stepanov
-
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.
-
Method Details
-
isFunctionalInterface
Whether the given type is a functional interface this factory can implement.- Parameters:
type- The target type- Returns:
- Whether the type is a functional interface
-
create
<T> T create(@Nullable jakarta.el.ELContext context, jakarta.el.LambdaExpression lambda, Class<T> type) Implements the functional interface with the lambda expression.- 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
-