Class ConfigurationPropertySources
java.lang.Object
org.springframework.boot.context.properties.source.ConfigurationPropertySources
Provides access to 
ConfigurationPropertySources.- Since:
- 2.0.0
- Author:
- Phillip Webb
- 
Method SummaryModifier and TypeMethodDescriptionstatic voidattach(Environment environment) Attach aConfigurationPropertySourcesupport to the specifiedEnvironment.static ConfigurablePropertyResolvercreatePropertyResolver(MutablePropertySources propertySources) Create a newPropertyResolverthat resolves property values against an underlying set ofPropertySources.static Iterable<ConfigurationPropertySource>from(Iterable<PropertySource<?>> sources) ReturnIterablecontaining newConfigurationPropertySourceinstances adapted from the given SpringPropertySources.static Iterable<ConfigurationPropertySource>from(PropertySource<?> source) ReturnIterablecontaining a single newConfigurationPropertySourceadapted from the given SpringPropertySource.static Iterable<ConfigurationPropertySource>get(Environment environment) Return a set ofConfigurationPropertySourceinstances that have previously beenattachedto theEnvironment.static booleanisAttachedConfigurationPropertySource(PropertySource<?> propertySource) Determines if the specificPropertySourceis theConfigurationPropertySourcethat wasattachedto theEnvironment.
- 
Method Details- 
createPropertyResolverpublic static ConfigurablePropertyResolver createPropertyResolver(MutablePropertySources propertySources) Create a newPropertyResolverthat resolves property values against an underlying set ofPropertySources. Provides anConfigurationPropertySourceaware and optimized alternative toPropertySourcesPropertyResolver.- Parameters:
- propertySources- the set of- PropertySourceobjects to use
- Returns:
- a ConfigurablePropertyResolverimplementation
- Since:
- 2.5.0
 
- 
isAttachedConfigurationPropertySourceDetermines if the specificPropertySourceis theConfigurationPropertySourcethat wasattachedto theEnvironment.- Parameters:
- propertySource- the property source to test
- Returns:
- trueif this is the attached- ConfigurationPropertySource
 
- 
attachAttach aConfigurationPropertySourcesupport to the specifiedEnvironment. Adapts eachPropertySourcemanaged by the environment to aConfigurationPropertySourceand allows classicPropertySourcesPropertyResolvercalls to resolve usingconfiguration property names.The attached resolver will dynamically track any additions or removals from the underlying Environmentproperty sources.- Parameters:
- environment- the source environment (must be an instance of- ConfigurableEnvironment)
- See Also:
 
- 
getReturn a set ofConfigurationPropertySourceinstances that have previously beenattachedto theEnvironment.- Parameters:
- environment- the source environment (must be an instance of- ConfigurableEnvironment)
- Returns:
- an iterable set of configuration property sources
- Throws:
- IllegalStateException- if not configuration property sources have been attached
 
- 
fromReturnIterablecontaining a single newConfigurationPropertySourceadapted from the given SpringPropertySource.- Parameters:
- source- the Spring property source to adapt
- Returns:
- an Iterablecontaining a single newly adaptedSpringConfigurationPropertySource
 
- 
fromReturnIterablecontaining newConfigurationPropertySourceinstances adapted from the given SpringPropertySources.This method will flatten any nested property sources and will filter all stub property sources. Updates to the underlying source, identified by changes in the sources returned by its iterator, will be automatically tracked. The underlying source should be thread safe, for example aMutablePropertySources- Parameters:
- sources- the Spring property sources to adapt
- Returns:
- an Iterablecontaining newly adaptedSpringConfigurationPropertySourceinstances
 
 
-