01: /* FunctionMapper.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Thu Aug 30 10:17:55 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.xel;
20:
21: import java.util.Collection;
22:
23: /**
24: * Used to customize the way to map between the XEL function names
25: * and the {@link Function} methods.
26: *
27: * @author tomyeh
28: * @since 3.0.0
29: */
30: public interface FunctionMapper {
31: /** Resolves a function {@link Function} with the specified name and
32: * prefix.
33: *
34: * <p>Note: not all EL evaluator support {@link #resolveFunction}.
35: * Currently only JSP 2.0/2.1 EL-based expression factories
36: * support this method.
37: * You can check {@link ExpressionFactory#isSupported} for this
38: * support.
39: *
40: * @param prefix the prefix of the function, or "" if no prefix
41: * @param name the name of the function to resolve
42: */
43: public Function resolveFunction(String prefix, String name)
44: throws XelException;
45:
46: /** Returns a readonly collection of the logic names of the class
47: * (never null).
48: * Note: it is the name to resolve class, not the real class name.
49: * In other words, it is the logical name maintained by this
50: * function mapper.
51: */
52: public Collection getClassNames();
53:
54: /** Resolves a class with the specified logic name,
55: * or null if not found.
56: *
57: * <p>Note: not all EL evaluator support {@link #resolveClass}.
58: * JSP 2.0/2.1 EL-based expression factories don't support
59: * this method.
60: * You can check {@link ExpressionFactory#isSupported} for this
61: * support.
62: *
63: * @return the class of the specified logic name.
64: */
65: public Class resolveClass(String name) throws XelException;
66: }
|