Class ValueExpressionLiteral
java.lang.Object
jakarta.el.Expression
jakarta.el.ValueExpression
org.apache.el.ValueExpressionLiteral
- All Implemented Interfaces:
Externalizable, Serializable
A literal value expression that represents a constant value.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new ValueExpressionLiteral for deserialization.ValueExpressionLiteral(Object value, Class<?> expectedType) Constructs a new ValueExpressionLiteral. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanCompares this literal value expression with another for equality.Class<?> Returns the expected type of the result of this expression.Returns the original string representation of this EL expression as it was parsed.Class<?> Returns the type of the result produced by evaluating this expression.<T> TEvaluates this expression and returns the result.inthashCode()booleanReturns whether this expression is a literal text expression, meaning it does not contain any variables, functions, or operators and evaluates to a constant value.booleanisReadOnly(ELContext context) Determines whether the property referenced by this expression is read-only.voidvoidSets the value of the property referenced by this expression.voidMethods inherited from class ValueExpression
getValueReference
-
Constructor Details
-
ValueExpressionLiteral
public ValueExpressionLiteral()Constructs a new ValueExpressionLiteral for deserialization. -
ValueExpressionLiteral
-
-
Method Details
-
getValue
Description copied from class:jakarta.el.ValueExpressionEvaluates this expression and returns the result.- Specified by:
getValuein classValueExpression- Type Parameters:
T- The expected type for the result of evaluating this value expression- Parameters:
context- The EL context for this evaluation- Returns:
- The result of evaluating this value expression
-
setValue
Description copied from class:jakarta.el.ValueExpressionSets the value of the property referenced by this expression.- Specified by:
setValuein classValueExpression- Parameters:
context- The EL context for this evaluationvalue- The value to set the property to which this value expression refers
-
isReadOnly
Description copied from class:jakarta.el.ValueExpressionDetermines whether the property referenced by this expression is read-only.- Specified by:
isReadOnlyin classValueExpression- Parameters:
context- The EL context for this evaluation- Returns:
trueif this expression is read only otherwisefalse
-
getType
Description copied from class:jakarta.el.ValueExpressionReturns the type of the result produced by evaluating this expression.- Specified by:
getTypein classValueExpression- Parameters:
context- The EL context for this evaluation- Returns:
- The type of the result of this value expression
-
getExpectedType
Description copied from class:jakarta.el.ValueExpressionReturns the expected type of the result of this expression.- Specified by:
getExpectedTypein classValueExpression- Returns:
- The expected result type, or
Object.classif no specific type is expected
-
getExpressionString
Description copied from class:jakarta.el.ExpressionReturns the original string representation of this EL expression as it was parsed.- Specified by:
getExpressionStringin classExpression- Returns:
- the string representation of this expression
-
equals
- Specified by:
equalsin classExpression
-
equals
Compares this literal value expression with another for equality.- Parameters:
ve- The other literal value expression- Returns:
trueif the values are equal,falseotherwise
-
hashCode
public int hashCode()- Specified by:
hashCodein classExpression
-
isLiteralText
public boolean isLiteralText()Description copied from class:jakarta.el.ExpressionReturns whether this expression is a literal text expression, meaning it does not contain any variables, functions, or operators and evaluates to a constant value.- Specified by:
isLiteralTextin classExpression- Returns:
trueif this expression is a literal text,falseotherwise
-
writeExternal
- Specified by:
writeExternalin interfaceExternalizable- Throws:
IOException
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Throws:
IOExceptionClassNotFoundException
-