01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package javax.el;
19:
20: import java.util.HashMap;
21: import java.util.Locale;
22: import java.util.Map;
23:
24: /**
25: *
26: */
27: public abstract class ELContext {
28:
29: private Locale locale;
30:
31: private Map<Class<?>, Object> map;
32:
33: private boolean resolved;
34:
35: /**
36: *
37: */
38: public ELContext() {
39: this .resolved = false;
40: }
41:
42: public Object getContext(Class key) {
43: if (this .map == null) {
44: return null;
45: }
46: return this .map.get(key);
47: }
48:
49: public void putContext(Class key, Object contextObject)
50: throws NullPointerException {
51: if (key == null || contextObject == null) {
52: throw new NullPointerException();
53: }
54:
55: if (this .map == null) {
56: this .map = new HashMap<Class<?>, Object>();
57: }
58:
59: this .map.put(key, contextObject);
60: }
61:
62: public void setPropertyResolved(boolean resolved) {
63: this .resolved = resolved;
64: }
65:
66: public boolean isPropertyResolved() {
67: return this .resolved;
68: }
69:
70: public abstract ELResolver getELResolver();
71:
72: public abstract FunctionMapper getFunctionMapper();
73:
74: public abstract VariableMapper getVariableMapper();
75:
76: public Locale getLocale() {
77: return this .locale;
78: }
79:
80: public void setLocale(Locale locale) {
81: this.locale = locale;
82: }
83: }
|