Class CommonELResolver

java.lang.Object
jakarta.el.ELResolver
io.micronaut.el.resolver.CommonELResolver
All Implemented Interfaces:
io.micronaut.core.order.Ordered, ELMethodExecutor

@Internal public final class CommonELResolver extends jakarta.el.ELResolver implements ELMethodExecutor
Resolves the common JDK member operations without reflective invocation.

This resolver is intentionally small and only handles operations whose receiver and signature are unambiguous from the runtime type. All other operations continue through the regular resolver chain. It is placed after user resolvers, so applications can still override any of these operations.

Since:
1.1
Author:
Denis Stepanov
  • Constructor Details

    • CommonELResolver

      public CommonELResolver()
  • Method Details

    • getOrder

      public int getOrder()
      Description copied from interface: ELMethodExecutor
      Returns the executor order. Lower values run first, following the Micronaut Ordered contract, so direct/generated implementations can take precedence over a general fallback such as reflection.
      Specified by:
      getOrder in interface ELMethodExecutor
      Specified by:
      getOrder in interface io.micronaut.core.order.Ordered
      Returns:
      The order, zero by default
    • getValue

      public @Nullable Object getValue(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object property)
      Specified by:
      getValue in class jakarta.el.ELResolver
    • getType

      public @Nullable Class<?> getType(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object property)
      Specified by:
      getType in class jakarta.el.ELResolver
    • invoke

      public @Nullable Object invoke(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object method, Class<?> @Nullable [] paramTypes, @Nullable Object[] params)
      Overrides:
      invoke in class jakarta.el.ELResolver
    • 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: ELMethodExecutor
      Resolves an instance or static method, or a constructor represented by <init>.
      Specified by:
      resolve in interface ELMethodExecutor
      Parameters:
      context - The EL context
      base - The instance, or an ELClass for a static method or constructor
      method - The method name
      argumentTypes - The parameter types supplied when the method expression was created, or null
      arguments - The evaluated arguments, or null
      Returns:
      The resolved method, or null when this executor does not handle it
    • setValue

      public void setValue(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object property, @Nullable Object value)
      Specified by:
      setValue in class jakarta.el.ELResolver
    • isReadOnly

      public boolean isReadOnly(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object property)
      Specified by:
      isReadOnly in class jakarta.el.ELResolver
    • getCommonPropertyType

      public @Nullable Class<?> getCommonPropertyType(jakarta.el.ELContext context, @Nullable Object base)
      Specified by:
      getCommonPropertyType in class jakarta.el.ELResolver