Rename {Default=>Standard}Environment
Issue: SPR-8348
This commit is contained in:
@@ -41,7 +41,7 @@ import org.springframework.util.StringUtils;
|
||||
*
|
||||
* @author Chris Beams
|
||||
* @since 3.1
|
||||
* @see DefaultEnvironment
|
||||
* @see StandardEnvironment
|
||||
*/
|
||||
public abstract class AbstractEnvironment implements ConfigurableEnvironment {
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.Map;
|
||||
*
|
||||
* @author Chris Beams
|
||||
* @since 3.1
|
||||
* @see DefaultEnvironment
|
||||
* @see StandardEnvironment
|
||||
* @see org.springframework.context.ConfigurableApplicationContext#getEnvironment
|
||||
*/
|
||||
public interface ConfigurableEnvironment extends Environment, ConfigurablePropertyResolver {
|
||||
@@ -61,7 +61,7 @@ public interface ConfigurableEnvironment extends Environment, ConfigurableProper
|
||||
* certain user-defined property sources have search precedence over default property
|
||||
* sources such as the set of system properties or the set of system environment
|
||||
* variables.
|
||||
* @see DefaultEnvironment#DefaultEnvironment()
|
||||
* @see AbstractEnvironment#customizePropertySources
|
||||
*/
|
||||
MutablePropertySources getPropertySources();
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ package org.springframework.core.env;
|
||||
* <p>Configuration of the environment object must be done through the
|
||||
* {@link ConfigurableEnvironment} interface, returned from all
|
||||
* {@code AbstractApplicationContext} subclass {@code getEnvironment()} methods. See
|
||||
* {@link DefaultEnvironment} for several examples of using the ConfigurableEnvironment
|
||||
* {@link StandardEnvironment} for several examples of using the ConfigurableEnvironment
|
||||
* interface to manipulate property sources prior to application context refresh().
|
||||
*
|
||||
* @author Chris Beams
|
||||
@@ -61,7 +61,7 @@ package org.springframework.core.env;
|
||||
* @see EnvironmentCapable
|
||||
* @see ConfigurableEnvironment
|
||||
* @see AbstractEnvironment
|
||||
* @see DefaultEnvironment
|
||||
* @see StandardEnvironment
|
||||
* @see org.springframework.context.EnvironmentAware
|
||||
* @see org.springframework.context.ConfigurableApplicationContext#getEnvironment
|
||||
* @see org.springframework.context.ConfigurableApplicationContext#setEnvironment
|
||||
|
||||
@@ -41,7 +41,7 @@ package org.springframework.core.env;
|
||||
*
|
||||
* <h4>Example: adding a new property source with highest search priority</h4>
|
||||
* <pre class="code">
|
||||
* ConfigurableEnvironment environment = new DefaultEnvironment();
|
||||
* ConfigurableEnvironment environment = new StandardEnvironment();
|
||||
* MutablePropertySources propertySources = environment.getPropertySources();
|
||||
* Map<String, String> myMap = new HashMap<String, String>();
|
||||
* myMap.put("xyz", "myValue");
|
||||
@@ -51,14 +51,14 @@ package org.springframework.core.env;
|
||||
* <h4>Example: removing the default system properties property source</h4>
|
||||
* <pre class="code">
|
||||
* MutablePropertySources propertySources = environment.getPropertySources();
|
||||
* propertySources.remove(DefaultEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)
|
||||
* propertySources.remove(StandardEnvironment.SYSTEM_PROPERTIES_PROPERTY_SOURCE_NAME)
|
||||
* </pre>
|
||||
*
|
||||
* <h4>Example: mocking the system environment for testing purposes</h4>
|
||||
* <pre class="code">
|
||||
* MutablePropertySources propertySources = environment.getPropertySources();
|
||||
* MockPropertySource mockEnvVars = new MockPropertySource().withProperty("xyz", "myValue");
|
||||
* propertySources.replace(DefaultEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, mockEnvVars);
|
||||
* propertySources.replace(StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME, mockEnvVars);
|
||||
* </pre>
|
||||
*
|
||||
* When an {@link Environment} is being used by an ApplicationContext, it is important
|
||||
@@ -73,7 +73,7 @@ package org.springframework.core.env;
|
||||
* @see ConfigurableEnvironment
|
||||
* @see org.springframework.web.context.support.DefaultWebEnvironment
|
||||
*/
|
||||
public class DefaultEnvironment extends AbstractEnvironment {
|
||||
public class StandardEnvironment extends AbstractEnvironment {
|
||||
|
||||
/** System environment property source name: {@value} */
|
||||
public static final String SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME = "systemEnvironment";
|
||||
@@ -19,7 +19,7 @@ package org.springframework.core.io;
|
||||
import java.beans.PropertyEditorSupport;
|
||||
import java.io.IOException;
|
||||
|
||||
import org.springframework.core.env.DefaultEnvironment;
|
||||
import org.springframework.core.env.StandardEnvironment;
|
||||
import org.springframework.core.env.PropertyResolver;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.StringUtils;
|
||||
@@ -58,22 +58,22 @@ public class ResourceEditor extends PropertyEditorSupport {
|
||||
|
||||
/**
|
||||
* Create a new instance of the {@link ResourceEditor} class
|
||||
* using a {@link DefaultResourceLoader} and {@link DefaultEnvironment}.
|
||||
* using a {@link DefaultResourceLoader} and {@link StandardEnvironment}.
|
||||
*/
|
||||
public ResourceEditor() {
|
||||
this(new DefaultResourceLoader(), new DefaultEnvironment());
|
||||
this(new DefaultResourceLoader(), new StandardEnvironment());
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new instance of the {@link ResourceEditor} class
|
||||
* using the given {@link ResourceLoader} and a {@link DefaultEnvironment}.
|
||||
* using the given {@link ResourceLoader} and a {@link StandardEnvironment}.
|
||||
* @param resourceLoader the <code>ResourceLoader</code> to use
|
||||
* @deprecated as of Spring 3.1 in favor of
|
||||
* {@link #ResourceEditor(ResourceLoader, PropertyResolver)}
|
||||
*/
|
||||
@Deprecated
|
||||
public ResourceEditor(ResourceLoader resourceLoader) {
|
||||
this(resourceLoader, new DefaultEnvironment(), true);
|
||||
this(resourceLoader, new StandardEnvironment(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,7 +97,7 @@ public class ResourceEditor extends PropertyEditorSupport {
|
||||
*/
|
||||
@Deprecated
|
||||
public ResourceEditor(ResourceLoader resourceLoader, boolean ignoreUnresolvablePlaceholders) {
|
||||
this(resourceLoader, new DefaultEnvironment(), ignoreUnresolvablePlaceholders);
|
||||
this(resourceLoader, new StandardEnvironment(), ignoreUnresolvablePlaceholders);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,7 @@ import java.util.List;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.core.env.DefaultEnvironment;
|
||||
import org.springframework.core.env.StandardEnvironment;
|
||||
import org.springframework.core.env.Environment;
|
||||
import org.springframework.core.env.PropertyResolver;
|
||||
import org.springframework.core.io.Resource;
|
||||
@@ -64,23 +64,23 @@ public class ResourceArrayPropertyEditor extends PropertyEditorSupport {
|
||||
|
||||
/**
|
||||
* Create a new ResourceArrayPropertyEditor with a default
|
||||
* {@link PathMatchingResourcePatternResolver} and {@link DefaultEnvironment}.
|
||||
* {@link PathMatchingResourcePatternResolver} and {@link StandardEnvironment}.
|
||||
* @see PathMatchingResourcePatternResolver
|
||||
* @see Environment
|
||||
*/
|
||||
public ResourceArrayPropertyEditor() {
|
||||
this(new PathMatchingResourcePatternResolver(), new DefaultEnvironment(), true);
|
||||
this(new PathMatchingResourcePatternResolver(), new StandardEnvironment(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new ResourceArrayPropertyEditor with the given {@link ResourcePatternResolver}
|
||||
* and a {@link DefaultEnvironment}.
|
||||
* and a {@link StandardEnvironment}.
|
||||
* @param resourcePatternResolver the ResourcePatternResolver to use
|
||||
* @deprecated as of 3.1 in favor of {@link #ResourceArrayPropertyEditor(ResourcePatternResolver, Environment)}
|
||||
*/
|
||||
@Deprecated
|
||||
public ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver) {
|
||||
this(resourcePatternResolver, new DefaultEnvironment(), true);
|
||||
this(resourcePatternResolver, new StandardEnvironment(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -95,7 +95,7 @@ public class ResourceArrayPropertyEditor extends PropertyEditorSupport {
|
||||
|
||||
/**
|
||||
* Create a new ResourceArrayPropertyEditor with the given {@link ResourcePatternResolver}
|
||||
* and a {@link DefaultEnvironment}.
|
||||
* and a {@link StandardEnvironment}.
|
||||
* @param resourcePatternResolver the ResourcePatternResolver to use
|
||||
* @param ignoreUnresolvablePlaceholders whether to ignore unresolvable placeholders
|
||||
* if no corresponding system property could be found
|
||||
@@ -103,7 +103,7 @@ public class ResourceArrayPropertyEditor extends PropertyEditorSupport {
|
||||
*/
|
||||
@Deprecated
|
||||
public ResourceArrayPropertyEditor(ResourcePatternResolver resourcePatternResolver, boolean ignoreUnresolvablePlaceholders) {
|
||||
this(resourcePatternResolver, new DefaultEnvironment(), ignoreUnresolvablePlaceholders);
|
||||
this(resourcePatternResolver, new StandardEnvironment(), ignoreUnresolvablePlaceholders);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user