View Javadoc
1   /**
2    * Copyright 2010-2013 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.common.util.property;
17  
18  import java.util.List;
19  import java.util.Properties;
20  
21  import org.kuali.common.util.Encodings;
22  import org.kuali.common.util.Mode;
23  import org.springframework.util.PropertyPlaceholderHelper;
24  
25  public class PropertiesContext {
26  
27  	protected PropertyPlaceholderHelper helper = Constants.DEFAULT_PROPERTY_PLACEHOLDER_HELPER;
28  	protected String encoding = Encodings.UTF8;
29  	protected Mode missingLocationsMode = Mode.ERROR;
30  	protected Properties properties;
31  	protected List<String> locations;
32  
33  	public PropertiesContext() {
34  		this((Properties) null);
35  	}
36  
37  	public PropertiesContext(Properties properties) {
38  		super();
39  		this.properties = properties;
40  	}
41  
42  	public PropertiesContext(List<String> locations) {
43  		this(locations, Encodings.UTF8);
44  	}
45  
46  	public PropertiesContext(List<String> locations, String encoding) {
47  		super();
48  		this.encoding = encoding;
49  		this.locations = locations;
50  	}
51  
52  	public PropertyPlaceholderHelper getHelper() {
53  		return helper;
54  	}
55  
56  	public void setHelper(PropertyPlaceholderHelper helper) {
57  		this.helper = helper;
58  	}
59  
60  	public String getEncoding() {
61  		return encoding;
62  	}
63  
64  	public void setEncoding(String encoding) {
65  		this.encoding = encoding;
66  	}
67  
68  	public Properties getProperties() {
69  		return properties;
70  	}
71  
72  	public void setProperties(Properties properties) {
73  		this.properties = properties;
74  	}
75  
76  	public List<String> getLocations() {
77  		return locations;
78  	}
79  
80  	public void setLocations(List<String> locations) {
81  		this.locations = locations;
82  	}
83  
84  	public Mode getMissingLocationsMode() {
85  		return missingLocationsMode;
86  	}
87  
88  	public void setMissingLocationsMode(Mode missingLocationsMode) {
89  		this.missingLocationsMode = missingLocationsMode;
90  	}
91  }