01: /* Evaluator.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Thu Aug 30 15:43:48 2007, Created by tomyeh
10: }}IS_NOTE
11:
12: Copyright (C) 2007 Potix Corporation. All Rights Reserved.
13:
14: {{IS_RIGHT
15: This program is distributed under GPL Version 2.0 in the hope that
16: it will be useful, but WITHOUT ANY WARRANTY.
17: }}IS_RIGHT
18: */
19: package org.zkoss.zk.xel;
20:
21: import org.zkoss.xel.Expression;
22: import org.zkoss.xel.XelException;
23:
24: import org.zkoss.zk.ui.Page;
25: import org.zkoss.zk.ui.Component;
26:
27: /**
28: * A ZK specific expression builder that is based on XEL.
29: *
30: * @author tomyeh
31: * @since 3.0.0
32: */
33: public interface Evaluator extends java.io.Serializable {
34: /**
35: * Prepares the expression.
36: *
37: * @param expression the expression to be prepared for being evaluated
38: * later.
39: * @param expectedType the expected type of the result of the evaluation
40: */
41: public Expression parseExpression(String expression,
42: Class expectedType) throws XelException;
43:
44: /**
45: * Evaluates the expression.
46: *
47: * @param page the page, or null to ignore
48: */
49: public Object evaluate(Page page, Expression expression)
50: throws XelException;
51:
52: /**
53: * Evaluates the expression.
54: *
55: * @param comp the component, or null to ignore
56: */
57: public Object evaluate(Component comp, Expression expression)
58: throws XelException;
59: }
|