Skip to content

Commit af602bb

Browse files
committed
make the property resolver configurable
1 parent e4f753e commit af602bb

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

spring-context/src/main/java/org/springframework/context/support/PropertySourcesPlaceholderConfigurer.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,17 @@ public String getProperty(String key) {
154154
}
155155
}
156156

157-
processProperties(beanFactory, new PropertySourcesPropertyResolver(this.propertySources));
157+
processProperties(beanFactory, getPropertyResolver(this.propertySources));
158158
this.appliedPropertySources = this.propertySources;
159159
}
160160

161+
/**
162+
* Construct and provide a PropertyResolver from the given properties.
163+
*/
164+
public ConfigurablePropertyResolver getPropertyResolver(MutablePropertySources propertySources){
165+
return new PropertySourcesPropertyResolver(propertySources);
166+
}
167+
161168
/**
162169
* Visit each bean definition in the given bean factory and attempt to replace ${...} property
163170
* placeholders with values from the given properties.

0 commit comments

Comments
 (0)