Package org.sakaiproject.util
Class SakaiProperties
- java.lang.Object
-
- org.sakaiproject.util.SakaiProperties
-
- All Implemented Interfaces:
BeanFactoryPostProcessorCreator,org.springframework.beans.factory.InitializingBean
public class SakaiProperties extends Object implements BeanFactoryPostProcessorCreator, org.springframework.beans.factory.InitializingBean
A configurer for "sakai.properties" files. These differ from the usual Spring default properties files by mixing together lines which define property-value pairs and lines which define bean property overrides. The two can be distinguished because Sakai conventionally uses the bean name separator "@" instead of the default "." This class creates separate PropertyPlaceholderConfigurer and PropertyOverrideConfigurer objects to handle bean configuration, and loads them with the input properties. SakaiProperties configuration supports most of the properties documented for PropertiesFactoryBean, PropertyPlaceholderConfigurer, and PropertyOverrideConfigurer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classSakaiProperties.SakaiPropertiesFactoryBeanBlatantly stolen from the Spring classes in order to get access to the properties files as they are read in, this could not be done by overrides because the stupid finals and private vars, this is why frameworks should never use final and private in their code.... sigh
-
Constructor Summary
Constructors Constructor Description SakaiProperties()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()Collection<org.springframework.beans.factory.config.BeanFactoryPostProcessor>getBeanFactoryPostProcessors()PropertiesgetProperties()INTERNALPropertiesgetRawProperties()INTERNALMap<String,Properties>getSeparateProperties()Gets the individual properties from each properties file which is read invoidsetBeanNameAtEnd(boolean beanNameAtEnd)voidsetBeanNameSeparator(String beanNameSeparator)voidsetFileEncoding(String encoding)voidsetIgnoreInvalidKeys(boolean ignoreInvalidKeys)voidsetIgnoreResourceNotFound(boolean ignoreResourceNotFound)voidsetIgnoreUnresolvablePlaceholders(boolean ignoreUnresolvablePlaceholders)voidsetLocalOverride(boolean localOverride)voidsetLocation(org.springframework.core.io.Resource location)voidsetLocations(org.springframework.core.io.Resource[] locations)voidsetOrder(int order)voidsetPlaceholderPrefix(String placeholderPrefix)voidsetPlaceholderSuffix(String placeholderSuffix)voidsetProperties(Properties properties)voidsetPropertiesArray(Properties[] propertiesArray)voidsetSearchSystemEnvironment(boolean searchSystemEnvironment)voidsetSystemPropertiesMode(int systemPropertiesMode)voidsetSystemPropertiesModeName(String constantName)
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
Exception
-
getBeanFactoryPostProcessors
public Collection<org.springframework.beans.factory.config.BeanFactoryPostProcessor> getBeanFactoryPostProcessors()
- Specified by:
getBeanFactoryPostProcessorsin interfaceBeanFactoryPostProcessorCreator- Returns:
- new BeanFactoryPostProcessor beans
-
getSeparateProperties
public Map<String,Properties> getSeparateProperties()
Gets the individual properties from each properties file which is read in- Returns:
- a map of filename -> Properties
-
getProperties
public Properties getProperties()
INTERNAL- Returns:
- the set of properties after processing
-
getRawProperties
public Properties getRawProperties()
INTERNAL- Returns:
- the complete set of properties exactly as read from the files
-
setProperties
public void setProperties(Properties properties)
-
setPropertiesArray
public void setPropertiesArray(Properties[] propertiesArray)
-
setLocation
public void setLocation(org.springframework.core.io.Resource location)
-
setLocations
public void setLocations(org.springframework.core.io.Resource[] locations)
-
setFileEncoding
public void setFileEncoding(String encoding)
-
setIgnoreResourceNotFound
public void setIgnoreResourceNotFound(boolean ignoreResourceNotFound)
-
setLocalOverride
public void setLocalOverride(boolean localOverride)
-
setIgnoreUnresolvablePlaceholders
public void setIgnoreUnresolvablePlaceholders(boolean ignoreUnresolvablePlaceholders)
-
setOrder
public void setOrder(int order)
-
setPlaceholderPrefix
public void setPlaceholderPrefix(String placeholderPrefix)
-
setPlaceholderSuffix
public void setPlaceholderSuffix(String placeholderSuffix)
-
setSearchSystemEnvironment
public void setSearchSystemEnvironment(boolean searchSystemEnvironment)
-
setSystemPropertiesMode
public void setSystemPropertiesMode(int systemPropertiesMode)
-
setSystemPropertiesModeName
public void setSystemPropertiesModeName(String constantName) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
setBeanNameAtEnd
public void setBeanNameAtEnd(boolean beanNameAtEnd)
-
setBeanNameSeparator
public void setBeanNameSeparator(String beanNameSeparator)
-
setIgnoreInvalidKeys
public void setIgnoreInvalidKeys(boolean ignoreInvalidKeys)
-
-