|
class ConfigurationPropertySourcesPropertySource extends PropertySource<Iterable<ConfigurationPropertySource>> |
In Springboot application,ConfigurationPropertySourcesPropertySource is added to the environment and as first element, the ConfigurationPropertySourcesPropertySource acts as a facade over the existing property sources.
When handling @Value annotation, org.springframework.core.env.PropertySourcesPropertyResolver#getProperty will be called.
If the property is found then ConfigurationPropertySourcesPropertySource will return the result. otherwise, PropertySourcesPropertyResolver continues to check all subsequent sources. This is a little inefficient for any source that has already been check via ConfigurationPropertySourcesPropertySource.
spring-boot/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/source/ConfigurationPropertySourcesPropertySource.java
Line 33 in aaad772
In Springboot application,ConfigurationPropertySourcesPropertySource is added to the environment and as first element, the ConfigurationPropertySourcesPropertySource acts as a facade over the existing property sources.
When handling
@Valueannotation, org.springframework.core.env.PropertySourcesPropertyResolver#getProperty will be called.If the property is found then ConfigurationPropertySourcesPropertySource will return the result. otherwise, PropertySourcesPropertyResolver continues to check all subsequent sources. This is a little inefficient for any source that has already been check via ConfigurationPropertySourcesPropertySource.