01: /* XelELContext.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Fri Aug 31 15:51:12 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.zkmax.xel.el21;
20:
21: import javax.el.ELContext;
22: import javax.el.ELResolver;
23: import javax.el.VariableMapper;
24: import javax.el.ValueExpression;
25:
26: import org.zkoss.xel.XelContext;
27:
28: /**
29: * An EL context that is based on XEL context.
30: *
31: * @author tomyeh
32: * @since 3.0.0
33: */
34: /*package*/class XelELContext extends ELContext {
35: private final XelContext _xelc;
36: private final ELResolver _resolver;
37:
38: private static final VariableMapper EMPTY_VAR_MAPPER = new VariableMapper() {
39: public ValueExpression resolveVariable(String variable) {
40: return null;
41: }
42:
43: public ValueExpression setVariable(String variable,
44: ValueExpression expression) {
45: throw new UnsupportedOperationException();
46: }
47: };
48:
49: /*package*/XelELContext(XelContext xelc) {
50: _xelc = xelc;
51: _resolver = new XelELResolver(xelc.getVariableResolver());
52: }
53:
54: public ELResolver getELResolver() {
55: return _resolver;
56: }
57:
58: public javax.el.FunctionMapper getFunctionMapper() {
59: return _xelc != null ? new XelELMapper(_xelc
60: .getFunctionMapper()) : null;
61: }
62:
63: public VariableMapper getVariableMapper() {
64: return EMPTY_VAR_MAPPER; //not support
65: }
66: }
|