1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 package org.kuali.rice.kns.util;
20
21 import java.util.Collection;
22 import java.util.Map;
23 import java.util.Set;
24
25 import org.kuali.rice.kns.util.properties.PropertyTree;
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45 public abstract class JstlPropertyHolder implements Map {
46 private PropertyTree propertyTree;
47
48
49
50
51 public JstlPropertyHolder() {
52 propertyTree = null;
53 }
54
55 protected void setProperties(Map<String,String> properties) {
56 propertyTree = new PropertyTree();
57 propertyTree.setProperties(properties);
58 }
59
60
61
62
63
64
65
66 protected void setPropertyTree(PropertyTree tree) {
67 propertyTree = tree;
68 }
69
70
71
72
73
74
75 public Object get(Object key) {
76 if (propertyTree == null) {
77 throw new IllegalStateException("propertyTree has not been initialized");
78 }
79 return this.propertyTree.get(key);
80 }
81
82
83
84
85 public int size() {
86 if (propertyTree == null) {
87 throw new IllegalStateException("propertyTree has not been initialized");
88 }
89 return this.propertyTree.size();
90 }
91
92
93
94
95 public void clear() {
96 if (propertyTree == null) {
97 throw new IllegalStateException("propertyTree has not been initialized");
98 }
99 this.propertyTree.clear();
100 }
101
102
103
104
105 public boolean isEmpty() {
106 if (propertyTree == null) {
107 throw new IllegalStateException("propertyTree has not been initialized");
108 }
109 return this.propertyTree.isEmpty();
110 }
111
112
113
114
115 public boolean containsKey(Object key) {
116 if (propertyTree == null) {
117 throw new IllegalStateException("propertyTree has not been initialized");
118 }
119 return this.propertyTree.containsKey(key);
120 }
121
122
123
124
125 public boolean containsValue(Object value) {
126 if (propertyTree == null) {
127 throw new IllegalStateException("propertyTree has not been initialized");
128 }
129 return this.propertyTree.containsValue(value);
130 }
131
132
133
134
135 public Collection values() {
136 if (propertyTree == null) {
137 throw new IllegalStateException("propertyTree has not been initialized");
138 }
139 return this.propertyTree.values();
140 }
141
142
143
144
145 public void putAll(Map m) {
146 if (propertyTree == null) {
147 throw new IllegalStateException("propertyTree has not been initialized");
148 }
149 this.propertyTree.putAll(m);
150 }
151
152
153
154
155 public Set entrySet() {
156 if (propertyTree == null) {
157 throw new IllegalStateException("propertyTree has not been initialized");
158 }
159 return this.propertyTree.entrySet();
160 }
161
162
163
164
165 public Set keySet() {
166 if (propertyTree == null) {
167 throw new IllegalStateException("propertyTree has not been initialized");
168 }
169 return this.propertyTree.keySet();
170 }
171
172
173
174
175 public Object remove(Object key) {
176 if (propertyTree == null) {
177 throw new IllegalStateException("propertyTree has not been initialized");
178 }
179 return this.propertyTree.remove(key);
180 }
181
182
183
184
185 public Object put(Object key, Object value) {
186 if (propertyTree == null) {
187 throw new IllegalStateException("propertyTree has not been initialized");
188 }
189 return this.propertyTree.put(key, value);
190 }
191 }