Class StaticExpression
java.lang.Object
org.springframework.binding.expression.support.StaticExpression
- All Implemented Interfaces:
Expression
A simple expression evaluator that just returns a fixed result on each evaluation.
- Author:
- Keith Donald
-
Constructor Summary
ConstructorsConstructorDescriptionStaticExpression(Object value) Create a static evaluator for the given value. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the original string used to create this expression, unmodified.Evaluate this expression in the provided context and return the result of evaluation.Class<?>getValueType(Object context) Returns the most general type that can be passed to theExpression.setValue(Object, Object)method for the given context.inthashCode()voidsetExpressionString(String expressionString) Sets the static expression string.voidSet this expression in the provided context to the value provided.toString()
-
Constructor Details
-
StaticExpression
Create a static evaluator for the given value.- Parameters:
value- the value
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
getValue
Description copied from interface:ExpressionEvaluate this expression in the provided context and return the result of evaluation.- Specified by:
getValuein interfaceExpression- Parameters:
context- the context to evaluate this expression in- Returns:
- the evaluation result
- Throws:
EvaluationException- an exception occurred during expression evaluation
-
setValue
Description copied from interface:ExpressionSet this expression in the provided context to the value provided.- Specified by:
setValuein interfaceExpression- Parameters:
context- the context on which the new value should be setvalue- the new value to set- Throws:
EvaluationException- an exception occurred during expression evaluation
-
getValueType
Description copied from interface:ExpressionReturns the most general type that can be passed to theExpression.setValue(Object, Object)method for the given context.- Specified by:
getValueTypein interfaceExpression- Parameters:
context- the context to evaluate- Returns:
- the most general type of value that can be set on this context, or
nullif the type information cannot be determined
-
getExpressionString
Description copied from interface:ExpressionReturns the original string used to create this expression, unmodified.- Specified by:
getExpressionStringin interfaceExpression- Returns:
- the original expression string
-
setExpressionString
Sets the static expression string.- Parameters:
expressionString- the static expression string
-
toString
-