001 /**
002 * Copyright 2010-2013 The Kuali Foundation
003 *
004 * Licensed under the Educational Community License, Version 2.0 (the "License");
005 * you may not use this file except in compliance with the License.
006 * You may obtain a copy of the License at
007 *
008 * http://www.opensource.org/licenses/ecl2.php
009 *
010 * Unless required by applicable law or agreed to in writing, software
011 * distributed under the License is distributed on an "AS IS" BASIS,
012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 * See the License for the specific language governing permissions and
014 * limitations under the License.
015 */
016 package org.kuali.common.util.property;
017
018 import java.util.List;
019 import java.util.Properties;
020
021 import org.kuali.common.util.Mode;
022 import org.springframework.util.PropertyPlaceholderHelper;
023
024 public class PropertiesContext {
025
026 protected PropertyPlaceholderHelper helper = Constants.DEFAULT_PROPERTY_PLACEHOLDER_HELPER;
027 protected String encoding = Constants.DEFAULT_ENCODING;
028 protected Mode missingLocationsMode = Mode.ERROR;
029 protected Properties properties;
030 protected List<String> locations;
031
032 public PropertiesContext() {
033 this((Properties) null);
034 }
035
036 public PropertiesContext(Properties properties) {
037 super();
038 this.properties = properties;
039 }
040
041 public PropertiesContext(List<String> locations) {
042 this(locations, Constants.DEFAULT_ENCODING);
043 }
044
045 public PropertiesContext(List<String> locations, String encoding) {
046 super();
047 this.encoding = encoding;
048 this.locations = locations;
049 }
050
051 public PropertyPlaceholderHelper getHelper() {
052 return helper;
053 }
054
055 public void setHelper(PropertyPlaceholderHelper helper) {
056 this.helper = helper;
057 }
058
059 public String getEncoding() {
060 return encoding;
061 }
062
063 public void setEncoding(String encoding) {
064 this.encoding = encoding;
065 }
066
067 public Properties getProperties() {
068 return properties;
069 }
070
071 public void setProperties(Properties properties) {
072 this.properties = properties;
073 }
074
075 public List<String> getLocations() {
076 return locations;
077 }
078
079 public void setLocations(List<String> locations) {
080 this.locations = locations;
081 }
082
083 public Mode getMissingLocationsMode() {
084 return missingLocationsMode;
085 }
086
087 public void setMissingLocationsMode(Mode missingLocationsMode) {
088 this.missingLocationsMode = missingLocationsMode;
089 }
090 }