Class CompiledValueExpression
java.lang.Object
jakarta.el.Expression
jakarta.el.ValueExpression
io.micronaut.el.runtime.CompiledValueExpression
- All Implemented Interfaces:
CompiledExpression, Serializable
- Direct Known Subclasses:
LiteralValueExpression
public abstract class CompiledValueExpression
extends jakarta.el.ValueExpression
implements CompiledExpression
The base class of the
ValueExpression implementations generated at compilation time.
Subclasses implement evaluate(ELContext), which contains the compiled form of the
expression. Expressions that are lvalues additionally override setValue(ELContext, Object),
getType(ELContext) and isReadOnly(ELContext).
- Since:
- 1.0
- Author:
- Denis Stepanov
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCompiledValueExpression(String expressionString, Class<?> expectedType) protectedCompiledValueExpression(String expressionString, String canonicalForm, Class<?> expectedType) protectedCompiledValueExpression(String expressionString, String canonicalForm, Class<?> expectedType, boolean coerced) -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected abstract @Nullable Objectevaluate(jakarta.el.ELContext context) Evaluates the compiled expression.Class<?> final String@Nullable Class<?> getType(jakarta.el.ELContext context) <T> @Nullable TgetValue(jakarta.el.ELContext context) inthashCode()booleanbooleanisReadOnly(jakarta.el.ELContext context) voidtoString()Methods inherited from class jakarta.el.ValueExpression
getValueReference
-
Constructor Details
-
CompiledValueExpression
-
CompiledValueExpression
protected CompiledValueExpression(String expressionString, String canonicalForm, Class<?> expectedType) - Parameters:
expressionString- The original expressioncanonicalForm- The canonical form of the expression, which is what equality comparesexpectedType- The expected type of the evaluation result
-
CompiledValueExpression
protected CompiledValueExpression(String expressionString, String canonicalForm, Class<?> expectedType, boolean coerced) - Parameters:
expressionString- The original expressioncanonicalForm- The canonical form of the expression, which is what equality comparesexpectedType- The expected type of the evaluation resultcoerced- Whether the result of the evaluation has to be coerced to the expected type, which the compiler knows not to be the case when the static type of the expression is the expected type
-
-
Method Details
-
evaluate
Evaluates the compiled expression.- Parameters:
context- The context- Returns:
- The result of the evaluation, before the coercion to the expected type
-
getValue
public <T> @Nullable T getValue(jakarta.el.ELContext context) - Specified by:
getValuein classjakarta.el.ValueExpression
-
setValue
- Specified by:
setValuein classjakarta.el.ValueExpression
-
isReadOnly
public boolean isReadOnly(jakarta.el.ELContext context) - Specified by:
isReadOnlyin classjakarta.el.ValueExpression
-
getType
- Specified by:
getTypein classjakarta.el.ValueExpression
-
getExpectedType
- Specified by:
getExpectedTypein classjakarta.el.ValueExpression
-
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
-