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