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 */ 016package org.kuali.common.util.property; 017 018import java.util.List; 019import java.util.Properties; 020 021import org.kuali.common.util.Encodings; 022import org.kuali.common.util.Mode; 023import org.springframework.util.PropertyPlaceholderHelper; 024 025public class PropertiesContext { 026 027 protected PropertyPlaceholderHelper helper = Constants.DEFAULT_PROPERTY_PLACEHOLDER_HELPER; 028 protected String encoding = Encodings.UTF8; 029 protected Mode missingLocationsMode = Mode.ERROR; 030 protected Properties properties; 031 protected List<String> locations; 032 033 public PropertiesContext() { 034 this((Properties) null); 035 } 036 037 public PropertiesContext(Properties properties) { 038 super(); 039 this.properties = properties; 040 } 041 042 public PropertiesContext(List<String> locations) { 043 this(locations, Encodings.UTF8); 044 } 045 046 public PropertiesContext(List<String> locations, String encoding) { 047 super(); 048 this.encoding = encoding; 049 this.locations = locations; 050 } 051 052 public PropertyPlaceholderHelper getHelper() { 053 return helper; 054 } 055 056 public void setHelper(PropertyPlaceholderHelper helper) { 057 this.helper = helper; 058 } 059 060 public String getEncoding() { 061 return encoding; 062 } 063 064 public void setEncoding(String encoding) { 065 this.encoding = encoding; 066 } 067 068 public Properties getProperties() { 069 return properties; 070 } 071 072 public void setProperties(Properties properties) { 073 this.properties = properties; 074 } 075 076 public List<String> getLocations() { 077 return locations; 078 } 079 080 public void setLocations(List<String> locations) { 081 this.locations = locations; 082 } 083 084 public Mode getMissingLocationsMode() { 085 return missingLocationsMode; 086 } 087 088 public void setMissingLocationsMode(Mode missingLocationsMode) { 089 this.missingLocationsMode = missingLocationsMode; 090 } 091}