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