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:
Chris Beams
2010-12-08 07:59:41 +00:00
parent b3e36a335d
commit 8770ea96b0
2 changed files with 11 additions and 0 deletions

View File

@@ -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);

View File

@@ -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);
}