01: /* SimpleXelContext.java
02:
03: {{IS_NOTE
04: Purpose:
05:
06: Description:
07:
08: History:
09: Thu Aug 30 16:56:50 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.util;
20:
21: import org.zkoss.xel.XelContext;
22: import org.zkoss.xel.VariableResolver;
23: import org.zkoss.xel.FunctionMapper;
24:
25: /**
26: * A simple implementation of {@link XelContext}.
27: *
28: * @author tomyeh
29: * @since 3.0.0
30: */
31: public class SimpleXelContext implements XelContext {
32: private VariableResolver _resolver;
33: private FunctionMapper _mapper;
34:
35: public SimpleXelContext(VariableResolver resolver,
36: FunctionMapper mapper) {
37: _resolver = resolver;
38: _mapper = mapper;
39: }
40:
41: public SimpleXelContext(VariableResolver resolver) {
42: _resolver = resolver;
43: }
44:
45: public SimpleXelContext() {
46: }
47:
48: /** Sete the variable resovler, or null if not available.
49: */
50: public void setVariableResolver(VariableResolver resolver) {
51: _resolver = resolver;
52: }
53:
54: /** Sets the function mapper, or null if not available.
55: */
56: public void setFunctionMapper(FunctionMapper mapper) {
57: _mapper = mapper;
58: }
59:
60: //XelContext//
61: public VariableResolver getVariableResolver() {
62: return _resolver;
63: }
64:
65: public FunctionMapper getFunctionMapper() {
66: return _mapper;
67: }
68: }
|