Class IntrospectionELResolver

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

@Internal public final class IntrospectionELResolver extends jakarta.el.ELResolver implements ELMethodExecutor
The ELResolver resolving the types annotated with Introspected through the bean introspection generated for them at compilation time.

The properties are read and written through the generated BeanIntrospection, so no reflection is used. The methods annotated with io.micronaut.context.annotation.Executable are invoked the same way; the other methods are left to the rest of the chain. A type without an introspection is left unresolved, so that the standard resolvers of the specification can handle it.

Since:
1.0
Author:
Denis Stepanov
  • Constructor Details

    • IntrospectionELResolver

      public IntrospectionELResolver()
      Creates a resolver using the shared introspector.
    • IntrospectionELResolver

      public IntrospectionELResolver(boolean readOnly)
      Parameters:
      readOnly - Whether the resolver should reject the assignment of properties
    • IntrospectionELResolver

      public IntrospectionELResolver(io.micronaut.core.beans.BeanIntrospector introspector, boolean readOnly)
      Parameters:
      introspector - The introspector
      readOnly - Whether the resolver should reject the assignment of properties
  • 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
    • 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
    • invoke

      public @Nullable Object invoke(jakarta.el.ELContext context, @Nullable Object base, @Nullable Object method, Class<?> @Nullable [] paramTypes, Object @Nullable [] 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
    • getCommonPropertyType

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