diff --git a/spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java b/spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java index abbfec08ab2e..ff07ef8346bc 100644 --- a/spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java +++ b/spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java @@ -154,10 +154,17 @@ public String getProperty(String key) { } } - processProperties(beanFactory, new PropertySourcesPropertyResolver(this.propertySources)); + processProperties(beanFactory, getPropertyResolver(this.propertySources)); this.appliedPropertySources = this.propertySources; } + /** + * Construct and provide a PropertyResolver from the given properties. + */ + public ConfigurablePropertyResolver getPropertyResolver(MutablePropertySources propertySources){ + return new PropertySourcesPropertyResolver(propertySources); + } + /** * Visit each bean definition in the given bean factory and attempt to replace ${...} property * placeholders with values from the given properties.