1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.struts.chain.contexts;
19
20 import org.apache.commons.chain.Context;
21
22 import java.util.Collection;
23 import java.util.Map;
24 import java.util.Set;
25
26 /***
27 * <p> Provide a base class for any Context Implementation which is primarily
28 * intended for use in a subchain. </p> <p> Classes which extend
29 * <code>ContextWrapper</code> may implement typesafe property methods which
30 * also leave their values in the underlying context. </p>
31 */
32 public class ContextWrapper implements Context {
33 private Context base;
34
35 /***
36 * <p> Instantiate object as a composite around the given Context. </p>
37 *
38 * @param context Context instance to wrap
39 */
40 public ContextWrapper(Context context) {
41 this.base = context;
42 }
43
44 /***
45 * Provide the underlying Context for this composite.
46 *
47 * @return The undelrying Context
48 */
49 protected Context getBaseContext() {
50 return this.base;
51 }
52
53
54
55
56 public Set entrySet() {
57 return this.base.entrySet();
58 }
59
60 public Set keySet() {
61 return this.base.keySet();
62 }
63
64 public Collection values() {
65 return this.base.values();
66 }
67
68 public void clear() {
69 this.base.clear();
70 }
71
72 public void putAll(Map map) {
73
74 this.base.putAll(map);
75 }
76
77 public Object remove(Object key) {
78 return this.base.remove(key);
79 }
80
81 public Object put(Object key, Object value) {
82
83 return this.base.put(key, value);
84 }
85
86 public Object get(Object key) {
87 return this.base.get(key);
88 }
89
90 public boolean containsValue(Object o) {
91 return this.base.containsValue(o);
92 }
93
94 public boolean containsKey(Object o) {
95 return this.base.containsKey(o);
96 }
97
98 public boolean isEmpty() {
99 return this.base.isEmpty();
100 }
101
102 public int size() {
103 return this.base.size();
104 }
105 }