Interface ELExpressionSource


public interface ELExpressionSource
A source of the expressions compiled at compilation time.

An implementation is generated for every type declaring expressions with io.micronaut.el.annotation.ELExpression and is registered as a service, so that CompiledExpressionFactory can return the compiled expression instead of parsing the expression string.

Since:
1.0
Author:
Denis Stepanov
  • Method Details

    • expressions

      default List<String> expressions()
      The expression strings this source declares, so that CompiledExpressionFactory can index the sources once and consult only the ones declaring the expression it is asked for.

      A source returning an empty list is consulted for every expression, which keeps a source generated before this method existed working, at the cost of a lookup per expression.

      Returns:
      The expression strings, value and method expressions alike
    • createValueExpression

      default @Nullable jakarta.el.ValueExpression createValueExpression(String expression, Class<?> expectedType)
      Parameters:
      expression - The expression string
      expectedType - The expected type
      Returns:
      The compiled value expression or null when this source does not declare it
    • createMethodExpression

      default @Nullable jakarta.el.MethodExpression createMethodExpression(String expression, Class<?> expectedReturnType, Class<?>[] expectedParamTypes)
      Parameters:
      expression - The expression string
      expectedReturnType - The expected return type
      expectedParamTypes - The expected parameter types
      Returns:
      The compiled method expression or null when this source does not declare it