Class InterpretingELExpressionParser

java.lang.Object
io.micronaut.el.interpreter.InterpretingELExpressionParser
All Implemented Interfaces:
ELExpressionParser

@Internal public final class InterpretingELExpressionParser extends Object implements ELExpressionParser
Creates the expressions that were not compiled at compilation time by parsing them at runtime.

The implementation is registered as a service, so adding this module to the runtime classpath is enough to make jakarta.el.ExpressionFactory accept expression strings that are only known at runtime.

Since:
1.0
Author:
Denis Stepanov
  • Constructor Details

    • InterpretingELExpressionParser

      public InterpretingELExpressionParser()
      Creates a parser using the method executors visible to the context class loader.
    • InterpretingELExpressionParser

      public InterpretingELExpressionParser(List<ELMethodExecutor> executors)
      Creates a parser using the given method executors, instead of the ones the context class loader declares as services.

      This is how an application registers its own executor programmatically, and the only way it can leave one out: a deployment that must not reach a method reflectively passes the executors it wants, rather than relying on the reflective one being absent from the classpath.

      Parameters:
      executors - The executors, in any order; they are consulted following the Ordered contract
  • Method Details

    • createValueExpression

      public jakarta.el.ValueExpression createValueExpression(@Nullable jakarta.el.ELContext context, String expression, Class<?> expectedType)
      Description copied from interface: ELExpressionParser
      Parses a value expression.
      Specified by:
      createValueExpression in interface ELExpressionParser
      Parameters:
      context - The context the expression is created for, can be null
      expression - The expression
      expectedType - The expected type of the evaluation result
      Returns:
      The value expression
    • createMethodExpression

      public jakarta.el.MethodExpression createMethodExpression(@Nullable jakarta.el.ELContext context, String expression, Class<?> expectedReturnType, Class<?> @Nullable [] expectedParamTypes)
      Description copied from interface: ELExpressionParser
      Parses a method expression.
      Specified by:
      createMethodExpression in interface ELExpressionParser
      Parameters:
      context - The context the expression is created for, can be null
      expression - The expression
      expectedReturnType - The expected return type
      expectedParamTypes - The expected parameter types
      Returns:
      The method expression