org.springframework.beans.factory.config
Class PropertyResourceConfigurer

Direct Known Subclasses:
PropertyOverrideConfigurer, PropertyPlaceholderConfigurer

public abstract class PropertyResourceConfigurer
implements BeanFactoryPostProcessor, Ordered

Allows for configuration of individual bean property values from a property resource, i.e. a properties file. Useful for custom config files targetted at system administrators that override bean properties configured in the application context.

2 concrete implementations are provided in the distribution:

Author:
Juergen Hoeller
Since: 02.10.2003
See Also: PropertyOverrideConfigurer, PropertyPlaceholderConfigurer

Method Summary
 intgetOrder()
           
 voidpostProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
           
 voidsetIgnoreResourceNotFound(boolean ignoreResourceNotFound)
          Set if failure to find the property resource should be ignored.
 voidsetLocation(Resource location)
          Set a location of a properties file to be loaded.
 voidsetLocations(Resource[] locations)
          Set locations of properties files to be loaded.
 voidsetOrder(int order)
           
 voidsetProperties(Properties properties)
          Set local properties, e.g.

Method Detail

getOrder

public int getOrder()

postProcessBeanFactory

public void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory)
throws org.springframework.beans.BeansException

setIgnoreResourceNotFound

public void setIgnoreResourceNotFound(boolean ignoreResourceNotFound)
Set if failure to find the property resource should be ignored. True is appropriate if the properties file is completely optional. Default is false.

setLocation

public void setLocation(Resource location)
Set a location of a properties file to be loaded.

setLocations

public void setLocations(Resource[] locations)
Set locations of properties files to be loaded.

setOrder

public void setOrder(int order)

setProperties

public void setProperties(Properties properties)
Set local properties, e.g. via the "props" tag in XML bean definitions. These can be considered defaults, to be overridden by properties loaded from files.

Association Links

to Class java.util.Properties

to Class org.springframework.core.io.Resource