Expose Environment ConfigurationService
AbstractEnvironment delegates to an underlying ConfigurationService when processing methods such as getProperty(String name, Class<?> targetType) Accessor methods have been added to the ConfigurableEnvironment interface that allow this service to be updated or replaced.
This commit is contained in:
@@ -69,7 +69,13 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment {
|
||||
new PropertyPlaceholderHelper(PLACEHOLDER_PREFIX, PLACEHOLDER_SUFFIX, VALUE_SEPARATOR, false);
|
||||
|
||||
|
||||
public ConversionService getConversionService() {
|
||||
return this.conversionService;
|
||||
}
|
||||
|
||||
public void setConversionService(ConversionService conversionService) {
|
||||
this.conversionService = conversionService;
|
||||
}
|
||||
|
||||
public void addPropertySource(PropertySource<?> propertySource) {
|
||||
propertySources.push(propertySource);
|
||||
|
||||
@@ -16,6 +16,8 @@
|
||||
|
||||
package org.springframework.core.env;
|
||||
|
||||
import org.springframework.core.convert.ConversionService;
|
||||
|
||||
/**
|
||||
* TODO SPR-7508: document
|
||||
*
|
||||
@@ -34,4 +36,7 @@ public interface ConfigurableEnvironment extends Environment, PropertySourceAggr
|
||||
*/
|
||||
void setDefaultProfiles(String... profiles);
|
||||
|
||||
public ConversionService getConversionService();
|
||||
|
||||
public void setConversionService(ConversionService conversionService);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user