Class CompiledMethodExpression

java.lang.Object
jakarta.el.Expression
jakarta.el.MethodExpression
io.micronaut.el.runtime.CompiledMethodExpression
All Implemented Interfaces:
CompiledExpression, Serializable
Direct Known Subclasses:
LiteralMethodExpression

public abstract class CompiledMethodExpression extends jakarta.el.MethodExpression implements CompiledExpression
The base class of the MethodExpression implementations generated at compilation time.
Since:
1.0
Author:
Denis Stepanov
See Also:
  • Constructor Details

    • CompiledMethodExpression

      protected CompiledMethodExpression(String expressionString, Class<?> expectedReturnType, @Nullable Class<?>[] expectedParamTypes, boolean parametersProvided)
      Parameters:
      expressionString - The original expression
      expectedReturnType - The expected return type
      expectedParamTypes - The expected parameter types
      parametersProvided - Whether the parameters are provided by the expression itself
    • CompiledMethodExpression

      protected CompiledMethodExpression(String expressionString, String canonicalForm, Class<?> expectedReturnType, @Nullable Class<?>[] expectedParamTypes, boolean parametersProvided)
      Parameters:
      expressionString - The original expression
      canonicalForm - The canonical form of the expression, which is what equality compares
      expectedReturnType - The expected return type
      expectedParamTypes - The expected parameter types
      parametersProvided - Whether the parameters are provided by the expression itself
  • Method Details

    • evaluateBase

      protected abstract @Nullable Object evaluateBase(jakarta.el.ELContext context)
      Evaluates the base object the method is invoked on, null for a method expression consisting of a single identifier.
      Parameters:
      context - The context
      Returns:
      The base object
    • evaluateProperty

      protected abstract @Nullable Object evaluateProperty(jakarta.el.ELContext context)
      Parameters:
      context - The context
      Returns:
      The name of the invoked method
    • doInvoke

      protected abstract @Nullable Object doInvoke(jakarta.el.ELContext context, @Nullable Object[] arguments)
      Performs the compiled invocation.
      Parameters:
      context - The context
      arguments - The arguments passed to invoke(ELContext, Object[])
      Returns:
      The result of the invocation, before the coercion to the expected return type
    • evaluateArguments

      protected Object @Nullable [] evaluateArguments(jakarta.el.ELContext context)
      Evaluates the parameters an expression such as ${bean.method(a, b)} provides itself.
      Parameters:
      context - The context
      Returns:
      The evaluated parameters, null for an expression that does not provide them
    • invoke

      public @Nullable Object invoke(jakarta.el.ELContext context, @Nullable Object[] params)
      Specified by:
      invoke in class jakarta.el.MethodExpression
    • getMethodInfo

      public jakarta.el.MethodInfo getMethodInfo(jakarta.el.ELContext context)
      Specified by:
      getMethodInfo in class jakarta.el.MethodExpression
    • getMethodReference

      public jakarta.el.MethodReference getMethodReference(jakarta.el.ELContext context)
      Overrides:
      getMethodReference in class jakarta.el.MethodExpression
    • isParametersProvided

      public boolean isParametersProvided()
      Overrides:
      isParametersProvided in class jakarta.el.MethodExpression
    • getExpectedReturnType

      protected Class<?> getExpectedReturnType()
      Returns:
      The expected return type
    • getExpectedParamTypes

      protected Class<?>[] getExpectedParamTypes()
      Returns:
      The expected parameter types
    • getExpressionString

      public final String getExpressionString()
      Specified by:
      getExpressionString in interface CompiledExpression
      Specified by:
      getExpressionString in class jakarta.el.Expression
      Returns:
      The original expression string
    • isLiteralText

      public boolean isLiteralText()
      Specified by:
      isLiteralText in class jakarta.el.Expression
    • equals

      public boolean equals(Object obj)
      Specified by:
      equals in class jakarta.el.Expression
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class jakarta.el.Expression
    • toString

      public String toString()
      Overrides:
      toString in class Object