01: /*
02: * Copyright 2006 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS,
12: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13: * See the License for the specific language governing permissions and
14: * limitations under the License.
15: */
16:
17: package org.apache.myfaces.el.unified;
18:
19: import javax.el.ELContext;
20: import javax.el.ELResolver;
21: import javax.el.FunctionMapper;
22: import javax.el.VariableMapper;
23: import javax.faces.context.FacesContext;
24:
25: /**
26: * ELContext used for JSF.
27: *
28: * @author Stan Silvert
29: */
30: public class FacesELContext extends ELContext {
31:
32: private ELResolver _elResolver;
33: private FunctionMapper _functionMapper;
34: private VariableMapper _variableMapper;
35:
36: public FacesELContext(ELResolver elResolver,
37: FacesContext facesContext) {
38: this ._elResolver = elResolver;
39: putContext(FacesContext.class, facesContext);
40:
41: // TODO: decide if we need to implement our own FunctionMapperImpl and
42: // VariableMapperImpl instead of relying on Tomcat's version.
43: //this.functionMapper = new FunctionMapperImpl();
44: //this.variableMapper = new VariableMapperImpl();
45: }
46:
47: public VariableMapper getVariableMapper() {
48: return _variableMapper;
49: }
50:
51: public void setVariableMapper(VariableMapper varMapper) {
52: _variableMapper = varMapper;
53: }
54:
55: public FunctionMapper getFunctionMapper() {
56: return _functionMapper;
57: }
58:
59: public void setFunctionMapper(FunctionMapper functionMapper) {
60: _functionMapper = functionMapper;
61: }
62:
63: public ELResolver getELResolver() {
64: return _elResolver;
65: }
66:
67: }
|