Restore customization of PropertyResolver

This commit reintroduces the ability to customize the PropertyResolver
to use in PropertySourcesPropertyResolver

See gh-26761
This commit is contained in:
lwpro2
2021-04-05 16:41:19 +08:00
committed by Stephane Nicoll
parent 89b7a6bf47
commit 00fffb7ab0

View File

@@ -170,10 +170,17 @@ public class PropertySourcesPlaceholderConfigurer extends PlaceholderConfigurerS
}
}
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.