org.springframework.binding.expression.support
Class StaticExpression
java.lang.Object
org.springframework.binding.expression.support.StaticExpression
- All Implemented Interfaces:
- Expression
public class StaticExpression
- extends java.lang.Object
- implements Expression
A simple expression evaluator that just returns a fixed result on each evaluation.
- Author:
- Keith Donald
Constructor Summary |
StaticExpression(java.lang.Object value)
Create a static evaluator for the given value. |
Method Summary |
boolean |
equals(java.lang.Object o)
|
java.lang.Object |
evaluate(java.lang.Object target,
EvaluationContext context)
Evaluate the expression encapsulated by this evaluator against the provided target object and return the result
of the evaluation. |
int |
hashCode()
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
StaticExpression
public StaticExpression(java.lang.Object value)
- Create a static evaluator for the given value.
- Parameters:
value
- the value
hashCode
public int hashCode()
- Overrides:
hashCode
in class java.lang.Object
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in class java.lang.Object
evaluate
public java.lang.Object evaluate(java.lang.Object target,
EvaluationContext context)
throws EvaluationException
- Description copied from interface:
Expression
- Evaluate the expression encapsulated by this evaluator against the provided target object and return the result
of the evaluation.
- Specified by:
evaluate
in interface Expression
- Parameters:
target
- the target of the expressioncontext
- the expression evaluation context
- Returns:
- the evaluation result
- Throws:
EvaluationException
- an exception occured during evaluation
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
Copyright © 2009 Spring Framework. All Rights Reserved.