View Javadoc

1   /**
2    * Copyright 2005-2011 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.kuali.rice.core.util;
17  
18  import java.io.IOException;
19  import java.io.InputStream;
20  import java.io.OutputStream;
21  import java.io.Reader;
22  import java.util.InvalidPropertiesFormatException;
23  import java.util.Map;
24  import java.util.Properties;
25  
26  /**
27   * This is a description of what this class does - g don't forget to fill this in. 
28   * 
29   * @author Kuali Rice Team (rice.collab@kuali.org)
30   *
31   */
32  public class ImmutableProperties extends Properties {
33          
34          public ImmutableProperties(Properties properties){
35                  super();
36                  for(Object o: properties.keySet()){
37                          super.put(o, properties.get(o));
38                  }               
39          }
40  
41          @Override
42          public synchronized void load(InputStream inStream) throws IOException {
43                   throw new UnsupportedOperationException("This class is immutable");
44          }
45  
46          @Override
47          public synchronized void load(Reader reader) throws IOException {
48                  throw new UnsupportedOperationException("This class is immutable");
49          }
50  
51          @Override
52          public synchronized void loadFromXML(InputStream in) throws IOException,
53                          InvalidPropertiesFormatException {
54                  throw new UnsupportedOperationException("This class is immutable");
55          }
56  
57      @Deprecated
58          @Override
59          public synchronized void save(OutputStream out, String comments) {
60                  throw new UnsupportedOperationException("This class is immutable");
61          }
62  
63          @Override
64          public synchronized Object setProperty(String key, String value) {
65                  throw new UnsupportedOperationException("This class is immutable");
66          }
67  
68          @Override
69          public synchronized Object put(Object key, Object value) {
70                  throw new UnsupportedOperationException("This class is immutable");
71          }
72  
73          @Override
74          public synchronized void putAll(Map<? extends Object, ? extends Object> t) {
75                  throw new UnsupportedOperationException("This class is immutable");
76          }
77  
78          @Override
79          public synchronized Object remove(Object key) {
80                  throw new UnsupportedOperationException("This class is immutable");
81          }
82  
83  }