- java.lang.Object
-
- jakarta.el.Expression
-
- jakarta.el.ValueExpression
-
- org.omnifaces.el.ReadOnlyValueExpression
-
- All Implemented Interfaces:
Serializable
public class ReadOnlyValueExpression extends ValueExpression
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ReadOnlyValueExpression()Construct a read only value expression.ReadOnlyValueExpression(Class<?> expectedType)Construct a read only value expression.ReadOnlyValueExpression(Class<?> expectedType, Callback.SerializableReturning<Object> callback)Construct a read only value expression.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object object)Callback.SerializableReturning<Object>getCallbackReturning()Returns the functional interface that will be called when the value expression is resolvedClass<?>getExpectedType()StringgetExpressionString()Class<?>getType(ELContext context)ObjectgetValue(ELContext context)inthashCode()booleanisLiteralText()booleanisReadOnly(ELContext context)voidsetCallbackReturning(Callback.SerializableReturning<Object> callbackReturning)Sets the functional interface that will be called when the value expression is resolvedvoidsetValue(ELContext context, Object value)-
Methods inherited from class jakarta.el.ValueExpression
getValueReference
-
-
-
-
Constructor Detail
-
ReadOnlyValueExpression
public ReadOnlyValueExpression(Class<?> expectedType, Callback.SerializableReturning<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
public ReadOnlyValueExpression(Class<?> expectedType)
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 Detail
-
getValue
public Object getValue(ELContext context)
- Specified by:
getValuein classValueExpression
-
setValue
public void setValue(ELContext context, Object value)
- Specified by:
setValuein classValueExpression
-
isReadOnly
public boolean isReadOnly(ELContext context)
- Specified by:
isReadOnlyin classValueExpression
-
getType
public Class<?> getType(ELContext context)
- Specified by:
getTypein classValueExpression
-
getExpectedType
public Class<?> getExpectedType()
- Specified by:
getExpectedTypein classValueExpression
-
getExpressionString
public String getExpressionString()
- Specified by:
getExpressionStringin classExpression
-
equals
public boolean equals(Object object)
- Specified by:
equalsin classExpression
-
hashCode
public int hashCode()
- Specified by:
hashCodein classExpression
-
isLiteralText
public boolean isLiteralText()
- Specified by:
isLiteralTextin classExpression
-
getCallbackReturning
public Callback.SerializableReturning<Object> getCallbackReturning()
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
-
setCallbackReturning
public void setCallbackReturning(Callback.SerializableReturning<Object> callbackReturning)
Sets the functional interface that will be called when the value expression is resolved- Parameters:
callbackReturning- functional interface returning what the value expression will return- Since:
- 2.1
-
-