Save This Page
Home » spring-framework-2.5.5-with-dependencies » org.springframework » beans » factory » config » [javadoc | source]
org.springframework.beans.factory.config
public class: PropertiesFactoryBean [javadoc | source]
java.lang.Object
   org.springframework.core.io.support.PropertiesLoaderSupport
      org.springframework.beans.factory.config.PropertiesFactoryBean

All Implemented Interfaces:
    InitializingBean, FactoryBean

Direct Known Subclasses:
    ResourceMapFactoryBean

Allows for making a properties file from a classpath location available as Properties instance in a bean factory. Can be used to populate any bean property of type Properties via a bean reference.

Supports loading from a properties file and/or setting local properties on this FactoryBean. The created Properties instance will be merged from loaded and local values. If neither a location nor local properties are set, an exception will be thrown on initialization.

Can create a singleton or a new object on each request. Default is a singleton.

Fields inherited from org.springframework.core.io.support.PropertiesLoaderSupport:
XML_FILE_EXTENSION,  logger
Method from org.springframework.beans.factory.config.PropertiesFactoryBean Summary:
afterPropertiesSet,   createInstance,   getObject,   getObjectType,   isSingleton,   setSingleton
Methods from org.springframework.core.io.support.PropertiesLoaderSupport:
loadProperties,   mergeProperties,   setFileEncoding,   setIgnoreResourceNotFound,   setLocalOverride,   setLocation,   setLocations,   setProperties,   setPropertiesArray,   setPropertiesPersister
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.beans.factory.config.PropertiesFactoryBean Detail:
 public final  void afterPropertiesSet() throws IOException 
 protected Object createInstance() throws IOException 
    Template method that subclasses may override to construct the object returned by this factory. The default implementation returns the plain merged Properties instance.

    Invoked on initialization of this FactoryBean in case of a shared singleton; else, on each #getObject() call.

 public final Object getObject() throws IOException 
 public Class getObjectType() 
 public final boolean isSingleton() 
 public final  void setSingleton(boolean singleton) 
    Set whether a shared 'singleton' Properties instance should be created, or rather a new Properties instance on each request.

    Default is "true" (a shared singleton).