java.lang.Object
jakarta.el.Expression
jakarta.el.ValueExpression
org.omnifaces.el.ReadOnlyValueExpression
- All Implemented Interfaces:
Serializable
Implementation of a read only value expression that can be used when the value is not yet available at construction time, or when the
value would be too expensive to create and it's not yet clear if the expression will actually be evaluated.
A callback (lambda in Java 8) that obtains the value can be provided, or the getValue() method can be overridden.
- Since:
- 2.0
- Author:
- Arjan Tijms
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a read only value expression.ReadOnlyValueExpression(Class<?> expectedType) Construct a read only value expression.ReadOnlyValueExpression(Class<?> expectedType, FunctionalInterfaces.SerializableSupplier<Object> callback) Construct a read only value expression. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the functional interface that will be called when the value expression is resolvedClass<?>Class<?><T> TinthashCode()booleanbooleanisReadOnly(ELContext context) voidSets the functional interface that will be called when the value expression is resolvedvoidMethods inherited from class jakarta.el.ValueExpression
getValueReference
-
Constructor Details
-
ReadOnlyValueExpression
public ReadOnlyValueExpression(Class<?> expectedType, FunctionalInterfaces.SerializableSupplier<Object> callback) Construct a read only value expression.- Parameters:
expectedType- The type the result of the expression will be coerced to after evaluation.callback- The functional interface that will be called when the value expression is resolved.
-
ReadOnlyValueExpression
Construct a read only value expression.- Parameters:
expectedType- The type the result of the expression will be coerced to after evaluation.
-
ReadOnlyValueExpression
public ReadOnlyValueExpression()Construct a read only value expression.
-
-
Method Details
-
getValue
- Specified by:
getValuein classValueExpression
-
setValue
- Specified by:
setValuein classValueExpression
-
isReadOnly
- Specified by:
isReadOnlyin classValueExpression
-
getType
- Specified by:
getTypein classValueExpression
-
getExpectedType
- Specified by:
getExpectedTypein classValueExpression
-
getExpressionString
- Specified by:
getExpressionStringin classExpression
-
equals
- Specified by:
equalsin classExpression
-
hashCode
public int hashCode()- Specified by:
hashCodein classExpression
-
isLiteralText
public boolean isLiteralText()- Specified by:
isLiteralTextin classExpression
-
getCallback
Returns the functional interface that will be called when the value expression is resolved- Returns:
- the functional interface that will be called when the value expression is resolved
- Since:
- 2.1
-
setCallback
Sets the functional interface that will be called when the value expression is resolved- Parameters:
callback- functional interface returning what the value expression will return- Since:
- 2.1
-