org.sakaiproject.util
Class SakaiProperties

java.lang.Object
  extended by 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
 class SakaiProperties.SakaiPropertiesFactoryBean
          Blatantly 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....
 
Constructor Summary
SakaiProperties()
           
 
Method Summary
 void afterPropertiesSet()
           
 Collection<org.springframework.beans.factory.config.BeanFactoryPostProcessor> getBeanFactoryPostProcessors()
           
 Properties getProperties()
          INTERNAL
 Properties getRawProperties()
          INTERNAL
 Map<String,Properties> getSeparateProperties()
          Gets the individual properties from each properties file which is read in
 void setBeanNameAtEnd(boolean beanNameAtEnd)
           
 void setBeanNameSeparator(String beanNameSeparator)
           
 void setFileEncoding(String encoding)
           
 void setIgnoreInvalidKeys(boolean ignoreInvalidKeys)
           
 void setIgnoreResourceNotFound(boolean ignoreResourceNotFound)
           
 void setIgnoreUnresolvablePlaceholders(boolean ignoreUnresolvablePlaceholders)
           
 void setLocalOverride(boolean localOverride)
           
 void setLocation(org.springframework.core.io.Resource location)
           
 void setLocations(org.springframework.core.io.Resource[] locations)
           
 void setOrder(int order)
           
 void setPlaceholderPrefix(String placeholderPrefix)
           
 void setPlaceholderSuffix(String placeholderSuffix)
           
 void setProperties(Properties properties)
           
 void setPropertiesArray(Properties[] propertiesArray)
           
 void setSearchSystemEnvironment(boolean searchSystemEnvironment)
           
 void setSystemPropertiesMode(int systemPropertiesMode)
           
 void setSystemPropertiesModeName(String constantName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SakaiProperties

public SakaiProperties()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Throws:
Exception

getBeanFactoryPostProcessors

public Collection<org.springframework.beans.factory.config.BeanFactoryPostProcessor> getBeanFactoryPostProcessors()
Specified by:
getBeanFactoryPostProcessors in interface BeanFactoryPostProcessorCreator
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)


Copyright © 2003-2012 The Sakai Foundation. All Rights Reserved.