Class ContributedELMethodExecutor
java.lang.Object
io.micronaut.el.ContributedELMethodExecutor
- All Implemented Interfaces:
io.micronaut.core.order.Ordered, ELMethodExecutor
Dispatches the methods every
ELMethodContributor on the classpath registered.
This is the executor that brings contributions into the interpreter: it collects the contributors as
services once, merges their registrations into one ELMethodRegistry, and delegates to the executor
the registry builds. It runs before the built-in executors, so a contribution takes precedence over the
general handling of a type, and well before the reflective executor of the optional interpreter-reflection
module.
- Since:
- 1.1
- Author:
- Denis Stepanov
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intContributions describe one type each, so they are consulted before the built-in executors, which describe whole families of types, and before the reflective one, which describes anything.Fields inherited from interface io.micronaut.core.order.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE -
Constructor Summary
ConstructorsConstructorDescriptionCreates the executor from the contributors visible to the context class loader.ContributedELMethodExecutor(List<ELMethodContributor> contributors) Creates the executor from the given contributors. -
Method Summary
Modifier and TypeMethodDescriptionintgetOrder()Returns the executor order.@Nullable ELMethodresolve(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object method, io.micronaut.core.type.Argument<?> @Nullable [] argumentTypes, Object @Nullable [] arguments) Resolves an instance or static method, or a constructor represented by<init>.@Nullable ELMethodresolveFunction(jakarta.el.ELContext context, String prefix, String localName) Resolves a function bound by the expression context.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ELMethodExecutor
isReflective
-
Field Details
-
ORDER
public static final int ORDERContributions describe one type each, so they are consulted before the built-in executors, which describe whole families of types, and before the reflective one, which describes anything.- See Also:
-
-
Constructor Details
-
ContributedELMethodExecutor
public ContributedELMethodExecutor()Creates the executor from the contributors visible to the context class loader. -
ContributedELMethodExecutor
Creates the executor from the given contributors.- Parameters:
contributors- The contributors
-
-
Method Details
-
getOrder
public int getOrder()Description copied from interface:ELMethodExecutorReturns the executor order. Lower values run first, following the MicronautOrderedcontract, so direct/generated implementations can take precedence over a general fallback such as reflection.- Specified by:
getOrderin interfaceELMethodExecutor- Specified by:
getOrderin interfaceio.micronaut.core.order.Ordered- Returns:
- The order, zero by default
-
resolve
public @Nullable ELMethod resolve(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object method, io.micronaut.core.type.Argument<?> @Nullable [] argumentTypes, Object @Nullable [] arguments) Description copied from interface:ELMethodExecutorResolves an instance or static method, or a constructor represented by<init>.- Specified by:
resolvein interfaceELMethodExecutor- Parameters:
context- The EL contextbase- The instance, or anELClassfor a static method or constructormethod- The method nameargumentTypes- The parameter types supplied when the method expression was created, ornullarguments- The evaluated arguments, ornull- Returns:
- The resolved method, or
nullwhen this executor does not handle it
-
resolveFunction
public @Nullable ELMethod resolveFunction(jakarta.el.ELContext context, String prefix, String localName) Description copied from interface:ELMethodExecutorResolves a function bound by the expression context.The default implementation does not contribute functions. A reflection-backed implementation can use the Jakarta
FunctionMapperhere, while a generated implementation can provide functions without exposing reflective methods.- Specified by:
resolveFunctionin interfaceELMethodExecutor- Parameters:
context- The EL contextprefix- The function prefixlocalName- The function name- Returns:
- The resolved function, or
nullwhen this executor does not handle it
-