01: package org.concern.library.generic;
02:
03: import org.concern.controller.AbstractCondition;
04: import org.concern.controller.ConditionEvaluationException;
05: import ognl.Ognl;
06: import ognl.OgnlException;
07:
08: /**
09: * @author hengels
10: * @version $Revision$
11: */
12: public class NullCondition extends AbstractCondition {
13: String expression;
14:
15: public String getExpression() {
16: return expression;
17: }
18:
19: public void setExpression(String expression) {
20: this .expression = expression;
21: }
22:
23: public boolean eval(Object subject)
24: throws ConditionEvaluationException {
25: try {
26: Object result = Ognl.getValue(expression, subject);
27: return result == null;
28: } catch (OgnlException e) {
29: throw new ConditionEvaluationException(e.getMessage());
30: }
31: }
32: }
|