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 Summary
ConstructorsModifierConstructorDescriptionprotectedCompiledMethodExpression(String expressionString, Class<?> expectedReturnType, @Nullable Class<?>[] expectedParamTypes, boolean parametersProvided) protectedCompiledMethodExpression(String expressionString, String canonicalForm, Class<?> expectedReturnType, @Nullable Class<?>[] expectedParamTypes, boolean parametersProvided) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract @Nullable ObjectPerforms the compiled invocation.booleanprotected Object @Nullable []evaluateArguments(jakarta.el.ELContext context) Evaluates the parameters an expression such as${bean.method(a, b)}provides itself.protected abstract @Nullable ObjectevaluateBase(jakarta.el.ELContext context) Evaluates the base object the method is invoked on,nullfor a method expression consisting of a single identifier.protected abstract @Nullable ObjectevaluateProperty(jakarta.el.ELContext context) protected Class<?>[]protected Class<?> final Stringjakarta.el.MethodInfogetMethodInfo(jakarta.el.ELContext context) jakarta.el.MethodReferencegetMethodReference(jakarta.el.ELContext context) inthashCode()@Nullable ObjectbooleanbooleantoString()
-
Constructor Details
-
CompiledMethodExpression
protected CompiledMethodExpression(String expressionString, Class<?> expectedReturnType, @Nullable Class<?>[] expectedParamTypes, boolean parametersProvided) - Parameters:
expressionString- The original expressionexpectedReturnType- The expected return typeexpectedParamTypes- The expected parameter typesparametersProvided- 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 expressioncanonicalForm- The canonical form of the expression, which is what equality comparesexpectedReturnType- The expected return typeexpectedParamTypes- The expected parameter typesparametersProvided- Whether the parameters are provided by the expression itself
-
-
Method Details
-
evaluateBase
Evaluates the base object the method is invoked on,nullfor a method expression consisting of a single identifier.- Parameters:
context- The context- Returns:
- The base object
-
evaluateProperty
- 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 contextarguments- The arguments passed toinvoke(ELContext, Object[])- Returns:
- The result of the invocation, before the coercion to the expected return type
-
evaluateArguments
Evaluates the parameters an expression such as${bean.method(a, b)}provides itself.- Parameters:
context- The context- Returns:
- The evaluated parameters,
nullfor an expression that does not provide them
-
invoke
-
getMethodInfo
public jakarta.el.MethodInfo getMethodInfo(jakarta.el.ELContext context) - Specified by:
getMethodInfoin classjakarta.el.MethodExpression
-
getMethodReference
public jakarta.el.MethodReference getMethodReference(jakarta.el.ELContext context) - Overrides:
getMethodReferencein classjakarta.el.MethodExpression
-
isParametersProvided
public boolean isParametersProvided()- Overrides:
isParametersProvidedin classjakarta.el.MethodExpression
-
getExpectedReturnType
- Returns:
- The expected return type
-
getExpectedParamTypes
- Returns:
- The expected parameter types
-
getExpressionString
- Specified by:
getExpressionStringin interfaceCompiledExpression- Specified by:
getExpressionStringin classjakarta.el.Expression- Returns:
- The original expression string
-
isLiteralText
public boolean isLiteralText()- Specified by:
isLiteralTextin classjakarta.el.Expression
-
equals
- Specified by:
equalsin classjakarta.el.Expression
-
hashCode
public int hashCode()- Specified by:
hashCodein classjakarta.el.Expression
-
toString
-