org.springframework.beans.factory.FactoryBean<java.util.Properties>, org.springframework.beans.factory.InitializingBeanpublic class ConfigurationPropertiesFactoryBean
extends java.lang.Object
implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.FactoryBean<java.util.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 | Description |
|---|---|
ConfigurationPropertiesFactoryBean() |
|
ConfigurationPropertiesFactoryBean(Configuration configuration) |
| Modifier and Type | Method | Description |
|---|---|---|
void |
afterPropertiesSet() |
|
CompositeConfiguration |
getConfiguration() |
|
Configuration[] |
getConfigurations() |
|
org.springframework.core.io.Resource[] |
getLocations() |
|
java.util.Properties |
getObject() |
|
java.lang.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 java.util.Properties getObject()
throws java.lang.Exception
getObject in interface org.springframework.beans.factory.FactoryBean<java.util.Properties>java.lang.ExceptionFactoryBean.getObject()public java.lang.Class getObjectType()
getObjectType in interface org.springframework.beans.factory.FactoryBean<java.util.Properties>FactoryBean.getObjectType()public boolean isSingleton()
isSingleton in interface org.springframework.beans.factory.FactoryBean<java.util.Properties>FactoryBean.isSingleton()public void afterPropertiesSet()
throws java.lang.Exception
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanjava.lang.ExceptionInitializingBean.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–2018. All rights reserved.