public class ConfigurationPropertiesFactoryBean extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.FactoryBean<Properties>
FactoryBean which wraps a Commons CompositeConfiguration object for usage with PropertiesLoaderSupport. This allows the compositeConfiguration object to behave like a normal java.util.Properties object which can be passed on to setProperties() method allowing PropertyOverrideConfigurer and PropertyPlaceholderConfigurer to take advantage of Commons Configuration.
Internally a CompositeConfiguration object is used for merging multiple Configuration objects.
Properties,
PropertiesLoaderSupport| Constructor and Description |
|---|
ConfigurationPropertiesFactoryBean() |
ConfigurationPropertiesFactoryBean(Configuration configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
CompositeConfiguration |
getConfiguration() |
Configuration[] |
getConfigurations() |
org.springframework.core.io.Resource[] |
getLocations() |
Properties |
getObject() |
Class |
getObjectType() |
boolean |
isSingleton() |
boolean |
isThrowExceptionOnMissing() |
void |
setConfigurations(Configuration[] configurations)
Set the commons configurations objects which will be used as properties.
|
void |
setLocations(org.springframework.core.io.Resource[] locations)
Shortcut for loading compositeConfiguration from Spring resources.
|
void |
setThrowExceptionOnMissing(boolean throwExceptionOnMissing)
Set the underlying Commons CompositeConfiguration throwExceptionOnMissing flag.
|
public ConfigurationPropertiesFactoryBean()
public ConfigurationPropertiesFactoryBean(Configuration configuration)
public Properties getObject() throws Exception
getObject in interface org.springframework.beans.factory.FactoryBean<Properties>ExceptionFactoryBean.getObject()public Class getObjectType()
getObjectType in interface org.springframework.beans.factory.FactoryBean<Properties>FactoryBean.getObjectType()public boolean isSingleton()
isSingleton in interface org.springframework.beans.factory.FactoryBean<Properties>FactoryBean.isSingleton()public void afterPropertiesSet()
throws Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanExceptionInitializingBean.afterPropertiesSet()public Configuration[] getConfigurations()
public void setConfigurations(Configuration[] configurations)
configurations - commons configurations objects which will be used as properties.public org.springframework.core.io.Resource[] getLocations()
public void setLocations(org.springframework.core.io.Resource[] locations)
locations - resources of configuration filespublic boolean isThrowExceptionOnMissing()
public void setThrowExceptionOnMissing(boolean throwExceptionOnMissing)
throwExceptionOnMissing - The new value for the propertyAbstractConfiguration.setThrowExceptionOnMissing(boolean)public CompositeConfiguration getConfiguration()
Copyright © 2001–2016 The Apache Software Foundation. All rights reserved.