Skip to content

Commit

Permalink
make the property resolver configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
1zg12 committed Apr 5, 2021
1 parent e4f753e commit e06080e
Showing 1 changed file with 9 additions and 8 deletions.
Expand Up @@ -24,13 +24,7 @@
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.PlaceholderConfigurerSupport;
import org.springframework.context.EnvironmentAware;
import org.springframework.core.env.ConfigurablePropertyResolver;
import org.springframework.core.env.Environment;
import org.springframework.core.env.MutablePropertySources;
import org.springframework.core.env.PropertiesPropertySource;
import org.springframework.core.env.PropertySource;
import org.springframework.core.env.PropertySources;
import org.springframework.core.env.PropertySourcesPropertyResolver;
import org.springframework.core.env.*;
import org.springframework.lang.Nullable;
import org.springframework.util.Assert;
import org.springframework.util.StringValueResolver;
Expand Down Expand Up @@ -154,10 +148,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.
Expand Down

0 comments on commit e06080e

Please sign in to comment.