Class AbstractEnvironment

java.lang.Object
org.springframework.core.env.AbstractEnvironment
All Implemented Interfaces:
ConfigurableEnvironment, ConfigurablePropertyResolver, Environment, PropertyResolver
Direct Known Subclasses:
MockEnvironment, StandardEnvironment

public abstract class AbstractEnvironment extends Object implements ConfigurableEnvironment
Abstract base class for Environment implementations. Supports the notion of reserved default profile names and enables specifying active and default profiles through the ACTIVE_PROFILES_PROPERTY_NAME and DEFAULT_PROFILES_PROPERTY_NAME properties.

Concrete subclasses differ primarily on which PropertySource objects they add by default. AbstractEnvironment adds none. Subclasses should contribute property sources through the protected customizePropertySources(MutablePropertySources) hook, while clients should customize using ConfigurableEnvironment.getPropertySources() and working against the MutablePropertySources API. See ConfigurableEnvironment javadoc for usage examples.

Since:
3.1
Author:
Chris Beams, Juergen Hoeller, Phillip Webb
See Also: