Package org.sakaiproject.util
Class SakaiProperties.SakaiPropertiesFactoryBean
- java.lang.Object
-
- org.sakaiproject.util.SakaiProperties.SakaiPropertiesFactoryBean
-
- All Implemented Interfaces:
org.springframework.beans.factory.FactoryBean,org.springframework.beans.factory.InitializingBean
- Enclosing class:
- SakaiProperties
public class SakaiProperties.SakaiPropertiesFactoryBean extends Object implements org.springframework.beans.factory.FactoryBean, org.springframework.beans.factory.InitializingBean
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.... sigh- Author:
- Spring Framework, Aaron Zeckoski (azeckoski @ vt.edu)
-
-
Field Summary
Fields Modifier and Type Field Description static StringXML_FILE_EXTENSION
-
Constructor Summary
Constructors Constructor Description SakaiPropertiesFactoryBean()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()protected ObjectcreateInstance()Map<String,Properties>getLoadedProperties()ObjectgetObject()ClassgetObjectType()booleanisSingleton()protected voidloadProperties(Properties props)Load properties into the given instance.protected PropertiesmergeProperties()Return a merged Properties instance containing both the loaded properties and properties set on this FactoryBean.voidsetFileEncoding(String encoding)voidsetIgnoreResourceNotFound(boolean ignoreResourceNotFound)voidsetLocalOverride(boolean localOverride)voidsetLocation(org.springframework.core.io.Resource location)voidsetLocations(org.springframework.core.io.Resource[] locations)voidsetProperties(Properties properties)voidsetPropertiesArray(Properties[] propertiesArray)voidsetPropertiesPersister(org.springframework.util.PropertiesPersister propertiesPersister)voidsetSingleton(boolean singleton)
-
-
-
Field Detail
-
XML_FILE_EXTENSION
public static final String XML_FILE_EXTENSION
- See Also:
- Constant Field Values
-
-
Method Detail
-
getLoadedProperties
public Map<String,Properties> getLoadedProperties()
- Returns:
- a map of file -> properties for everything loaded here
-
setSingleton
public final void setSingleton(boolean singleton)
-
isSingleton
public final boolean isSingleton()
- Specified by:
isSingletonin interfaceorg.springframework.beans.factory.FactoryBean
-
afterPropertiesSet
public final void afterPropertiesSet() throws IOException- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
IOException
-
getObject
public final Object getObject() throws IOException
- Specified by:
getObjectin interfaceorg.springframework.beans.factory.FactoryBean- Throws:
IOException
-
getObjectType
public Class getObjectType()
- Specified by:
getObjectTypein interfaceorg.springframework.beans.factory.FactoryBean
-
createInstance
protected Object createInstance() throws IOException
- Throws:
IOException
-
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)
-
setLocalOverride
public void setLocalOverride(boolean localOverride)
-
setIgnoreResourceNotFound
public void setIgnoreResourceNotFound(boolean ignoreResourceNotFound)
-
setFileEncoding
public void setFileEncoding(String encoding)
-
setPropertiesPersister
public void setPropertiesPersister(org.springframework.util.PropertiesPersister propertiesPersister)
-
mergeProperties
protected Properties mergeProperties() throws IOException
Return a merged Properties instance containing both the loaded properties and properties set on this FactoryBean.- Throws:
IOException
-
loadProperties
protected void loadProperties(Properties props) throws IOException
Load properties into the given instance.- Parameters:
props- the Properties instance to load into- Throws:
IOException- in case of I/O errors- See Also:
setLocations(org.springframework.core.io.Resource[])
-
-