1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 package org.modeshape.jdbc.util;
25
26 import java.io.IOException;
27 import java.io.InputStream;
28 import java.io.OutputStream;
29 import java.io.PrintStream;
30 import java.io.PrintWriter;
31 import java.util.Collection;
32 import java.util.Collections;
33 import java.util.Enumeration;
34 import java.util.Map;
35 import java.util.Properties;
36 import java.util.Set;
37 import java.util.Map.Entry;
38
39
40
41
42 public class UnmodifiableProperties extends Properties {
43
44
45
46 private static final long serialVersionUID = -4670639332874922546L;
47 private Properties delegate;
48
49 public UnmodifiableProperties( Properties props ) {
50 super();
51 this.delegate = props != null ? props : new Properties();
52 }
53
54
55
56
57 @Override
58 public synchronized Object clone() {
59 return new UnmodifiableProperties(this.delegate);
60 }
61
62
63
64
65 @Override
66 public synchronized boolean contains( Object value ) {
67 return delegate.contains(value);
68 }
69
70
71
72
73 @Override
74 public boolean containsKey( Object key ) {
75 return this.delegate.containsKey(key);
76 }
77
78
79
80
81 @Override
82 public boolean containsValue( Object value ) {
83 return this.delegate.containsValue(value);
84 }
85
86
87
88
89 @Override
90 public Enumeration<Object> elements() {
91 return this.delegate.elements();
92 }
93
94
95
96
97 @Override
98 public boolean equals( Object o ) {
99 return this.delegate.equals(o);
100 }
101
102
103
104
105 @Override
106 public Object get( Object key ) {
107 return this.delegate.get(key);
108 }
109
110
111
112
113 @Override
114 public String getProperty( String key,
115 String defaultValue ) {
116 return this.delegate.getProperty(key, defaultValue);
117 }
118
119
120
121
122 @Override
123 public String getProperty( String key ) {
124 return this.delegate.getProperty(key);
125 }
126
127
128
129
130 @Override
131 public int hashCode() {
132 return this.delegate.hashCode();
133 }
134
135
136
137
138 @Override
139 public boolean isEmpty() {
140 return this.delegate.isEmpty();
141 }
142
143
144
145
146 @Override
147 public Enumeration<Object> keys() {
148 return this.delegate.keys();
149 }
150
151
152
153
154 @Override
155 public void list( PrintStream out ) {
156 this.delegate.list(out);
157 }
158
159
160
161
162 @Override
163 public void list( PrintWriter out ) {
164 this.delegate.list(out);
165 }
166
167
168
169
170 @Override
171 public Enumeration<?> propertyNames() {
172 return this.delegate.propertyNames();
173 }
174
175
176
177
178
179
180
181
182
183 @Deprecated
184 @Override
185 public void save( OutputStream out,
186 String comments ) {
187 this.delegate.save(out, comments);
188 }
189
190
191
192
193 @Override
194 public int size() {
195 return this.delegate.size();
196 }
197
198
199
200
201 @Override
202 public void store( OutputStream out,
203 String comments ) throws IOException {
204 this.delegate.store(out, comments);
205 }
206
207
208
209
210 @Override
211 public void storeToXML( OutputStream os,
212 String comment,
213 String encoding ) throws IOException {
214 this.delegate.storeToXML(os, comment, encoding);
215 }
216
217
218
219
220 @Override
221 public void storeToXML( OutputStream os,
222 String comment ) throws IOException {
223 this.delegate.storeToXML(os, comment);
224 }
225
226
227
228
229 @Override
230 public String toString() {
231 return this.delegate.toString();
232 }
233
234
235
236
237 @Override
238 public Collection<Object> values() {
239 return this.delegate.values();
240 }
241
242
243
244
245 @Override
246 public synchronized void clear() {
247 throw new UnsupportedOperationException();
248 }
249
250
251
252
253 @Override
254 public Set<Entry<Object, Object>> entrySet() {
255 return Collections.unmodifiableSet(super.entrySet());
256 }
257
258
259
260
261 @Override
262 public Set<Object> keySet() {
263 return Collections.unmodifiableSet(super.keySet());
264 }
265
266
267
268
269 @Override
270 public synchronized void load( InputStream inStream ) {
271 throw new UnsupportedOperationException();
272 }
273
274
275
276
277 @Override
278 public synchronized void loadFromXML( InputStream in ) {
279 throw new UnsupportedOperationException();
280 }
281
282
283
284
285 @Override
286 public synchronized Object put( Object key,
287 Object value ) {
288 throw new UnsupportedOperationException();
289 }
290
291
292
293
294 @Override
295 public synchronized void putAll( Map<? extends Object, ? extends Object> t ) {
296 throw new UnsupportedOperationException();
297 }
298
299
300
301
302 @Override
303 public synchronized Object remove( Object key ) {
304 throw new UnsupportedOperationException();
305 }
306
307
308
309
310 @Override
311 public synchronized Object setProperty( String key,
312 String value ) {
313 throw new UnsupportedOperationException();
314 }
315
316 }