|
|
|
@ -225,18 +225,14 @@ public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerS |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private static class ConfigurableEnvironmentPropertySource extends PropertySource<ConfigurableEnvironment> { |
|
|
|
private static class ConfigurableEnvironmentPropertySource extends PropertySource<ConfigurableEnvironment> { |
|
|
|
|
|
|
|
|
|
|
|
private final PropertySources propertySources; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ConfigurableEnvironmentPropertySource(ConfigurableEnvironment environment) { |
|
|
|
ConfigurableEnvironmentPropertySource(ConfigurableEnvironment environment) { |
|
|
|
super(ENVIRONMENT_PROPERTIES_PROPERTY_SOURCE_NAME, environment); |
|
|
|
super(ENVIRONMENT_PROPERTIES_PROPERTY_SOURCE_NAME, environment); |
|
|
|
this.propertySources = environment.getPropertySources(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public @Nullable Object getProperty(String name) { |
|
|
|
public @Nullable Object getProperty(String name) { |
|
|
|
for (PropertySource<?> propertySource : this.propertySources) { |
|
|
|
for (PropertySource<?> propertySource : super.source.getPropertySources()) { |
|
|
|
Object candidate = propertySource.getProperty(name); |
|
|
|
Object candidate = propertySource.getProperty(name); |
|
|
|
if (candidate != null) { |
|
|
|
if (candidate != null) { |
|
|
|
return candidate; |
|
|
|
return candidate; |
|
|
|
@ -247,7 +243,7 @@ public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerS |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public boolean containsProperty(String name) { |
|
|
|
public boolean containsProperty(String name) { |
|
|
|
for (PropertySource<?> propertySource : this.propertySources) { |
|
|
|
for (PropertySource<?> propertySource : super.source.getPropertySources()) { |
|
|
|
if (propertySource.containsProperty(name)) { |
|
|
|
if (propertySource.containsProperty(name)) { |
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -257,7 +253,7 @@ public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerS |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public String toString() { |
|
|
|
public String toString() { |
|
|
|
return "ConfigurableEnvironmentPropertySource {propertySources=" + this.propertySources + "}"; |
|
|
|
return "ConfigurableEnvironmentPropertySource {propertySources=" + super.source.getPropertySources() + "}"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|