org.sakaiproject.util
Class SakaiProperties.SakaiPropertiesFactoryBean

java.lang.Object
  extended by 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
static String XML_FILE_EXTENSION
           
 
Constructor Summary
SakaiProperties.SakaiPropertiesFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
protected  Object createInstance()
           
 Map<String,Properties> getLoadedProperties()
           
 Object getObject()
           
 Class getObjectType()
           
 boolean isSingleton()
           
protected  void loadProperties(Properties props)
          Load properties into the given instance.
protected  Properties mergeProperties()
          Return a merged Properties instance containing both the loaded properties and properties set on this FactoryBean.
 void setFileEncoding(String encoding)
           
 void setIgnoreResourceNotFound(boolean ignoreResourceNotFound)
           
 void setLocalOverride(boolean localOverride)
           
 void setLocation(org.springframework.core.io.Resource location)
           
 void setLocations(org.springframework.core.io.Resource[] locations)
           
 void setProperties(Properties properties)
           
 void setPropertiesArray(Properties[] propertiesArray)
           
 void setPropertiesPersister(org.springframework.util.PropertiesPersister propertiesPersister)
           
 void setSingleton(boolean singleton)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XML_FILE_EXTENSION

public static final String XML_FILE_EXTENSION
See Also:
Constant Field Values
Constructor Detail

SakaiProperties.SakaiPropertiesFactoryBean

public SakaiProperties.SakaiPropertiesFactoryBean()
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:
isSingleton in interface org.springframework.beans.factory.FactoryBean

afterPropertiesSet

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

getObject

public final Object getObject()
                       throws IOException
Specified by:
getObject in interface org.springframework.beans.factory.FactoryBean
Throws:
IOException

getObjectType

public Class getObjectType()
Specified by:
getObjectType in interface org.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[])


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