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 Summary
ConstructorsConstructorDescriptionCreates a parser using the method executors visible to the context class loader.InterpretingELExpressionParser(List<ELMethodExecutor> executors) Creates a parser using the given method executors, instead of the ones the context class loader declares as services. -
Method Summary
Modifier and TypeMethodDescriptionjakarta.el.MethodExpressioncreateMethodExpression(@Nullable jakarta.el.ELContext context, String expression, Class<?> expectedReturnType, Class<?> @Nullable [] expectedParamTypes) Parses a method expression.jakarta.el.ValueExpressioncreateValueExpression(@Nullable jakarta.el.ELContext context, String expression, Class<?> expectedType) Parses a value expression.
-
Constructor Details
-
InterpretingELExpressionParser
public InterpretingELExpressionParser()Creates a parser using the method executors visible to the context class loader. -
InterpretingELExpressionParser
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 theOrderedcontract
-
-
Method Details
-
createValueExpression
public jakarta.el.ValueExpression createValueExpression(@Nullable jakarta.el.ELContext context, String expression, Class<?> expectedType) Description copied from interface:ELExpressionParserParses a value expression.- Specified by:
createValueExpressionin interfaceELExpressionParser- Parameters:
context- The context the expression is created for, can benullexpression- The expressionexpectedType- 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:ELExpressionParserParses a method expression.- Specified by:
createMethodExpressionin interfaceELExpressionParser- Parameters:
context- The context the expression is created for, can benullexpression- The expressionexpectedReturnType- The expected return typeexpectedParamTypes- The expected parameter types- Returns:
- The method expression
-