Browse Source

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.
pull/7/head
Chris Beams 14 years ago
parent
commit
8770ea96b0
  1. 6
      org.springframework.core/src/main/java/org/springframework/core/env/AbstractEnvironment.java
  2. 5
      org.springframework.core/src/main/java/org/springframework/core/env/ConfigurableEnvironment.java

6
org.springframework.core/src/main/java/org/springframework/core/env/AbstractEnvironment.java vendored

@ -69,7 +69,13 @@ public abstract class AbstractEnvironment implements ConfigurableEnvironment { @@ -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);

5
org.springframework.core/src/main/java/org/springframework/core/env/ConfigurableEnvironment.java vendored

@ -16,6 +16,8 @@ @@ -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 @@ -34,4 +36,7 @@ public interface ConfigurableEnvironment extends Environment, PropertySourceAggr
*/
void setDefaultProfiles(String... profiles);
public ConversionService getConversionService();
public void setConversionService(ConversionService conversionService);
}

Loading…
Cancel
Save