java.lang.Object | |
↳ | org.springframework.core.env.AbstractEnvironment |
Known Direct Subclasses |
Known Indirect Subclasses |
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | ACTIVE_PROFILES_PROPERTY_NAME | Name of property to set to specify active profiles: {@value }. | |||||||||
String | DEFAULT_PROFILES_PROPERTY_NAME | Name of property to set to specify default profiles: {@value }. |
Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
logger |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Return whether the given property key is available for resolution.
| |||||||||||
Return the set of profiles explicitly made active for this environment.
| |||||||||||
Return the set of profiles to be active by default when no active profiles have been set explicitly.
| |||||||||||
Return the property value associated with the given key, or
null
if the key cannot be resolved. | |||||||||||
Return the property value associated with the given key.
| |||||||||||
Return the
PropertySources for this environment in mutable form
| |||||||||||
Return the property value associated with the given key, converted to the given
targetType (never
null ). | |||||||||||
Return the property value associated with the given key, converted to the given
targetType (never
null ). | |||||||||||
Return the value of
getenv() if allowed by the current SecurityManager,
otherwise return a map implementation that will attempt to access individual keys using calls to
getenv(String) . | |||||||||||
Return the value of
getProperties() if allowed by the current SecurityManager,
otherwise return a map implementation that will attempt to access individual keys using calls to
getProperty(String) . | |||||||||||
Resolve ${...} placeholders in the given text, replacing them with corresponding
property values as resolved by
getProperty(String) . | |||||||||||
Resolve ${...} placeholders in the given text, replacing them with corresponding
property values as resolved by
getProperty(String) . | |||||||||||
Specify the set of profiles active for this Environment.
| |||||||||||
Set the
ConversionService to be used when performing type
conversions on properties. | |||||||||||
Specify the set of profiles to be made active by default if no other profiles
are explicitly made active through
setActiveProfiles(String...) . | |||||||||||
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
org.springframework.core.env.ConfigurableEnvironment
| |||||||||||
From interface
org.springframework.core.env.ConfigurablePropertyResolver
| |||||||||||
From interface
org.springframework.core.env.Environment
| |||||||||||
From interface
org.springframework.core.env.PropertyResolver
|
Name of property to set to specify active profiles: {@value }. May be comma delimited.
Name of property to set to specify default profiles: {@value }. May be comma delimited.
Return whether the given property key is available for resolution.
Return the set of profiles explicitly made active for this environment. Profiles are used for
creating logical groupings of bean definitions to be registered conditionally, often based on
deployment environment. Profiles can be activated by setting "spring.profiles.active"
as a system property
or by calling setActiveProfiles(String)
.
If no profiles have explicitly been specified as active, then any 'default' profiles will implicitly be considered active.
Return the set of profiles to be active by default when no active profiles have been set explicitly.
Return the property value associated with the given key, or null
if the key cannot be resolved.
Return the property value associated with the given key.
Return the PropertySources
for this environment in mutable form
Return the property value associated with the given key, converted to the given
targetType (never null
).
IllegalStateException |
---|
Return the property value associated with the given key, converted to the given
targetType (never null
).
IllegalStateException |
---|
Return the value of getenv()
if allowed by the current SecurityManager,
otherwise return a map implementation that will attempt to access individual keys using calls to
getenv(String)
.
Note that most Environment
implementations will include this system environment map as
a default PropertySource
to be searched. Therefore, it is recommended that this method not be
used directly unless bypassing other property sources is expressly intended.
Calls to get(Object)
on the Map returned will never throw IllegalAccessException
;
in cases where the SecurityManager forbids access to a property, null
will be returned and an
INFO-level log message will be issued noting the exception.
Return the value of getProperties()
if allowed by the current SecurityManager,
otherwise return a map implementation that will attempt to access individual keys using calls to
getProperty(String)
.
Note that most Environment
implementations will include this system properties map as a
default PropertySource
to be searched. Therefore, it is recommended that this method not be
used directly unless bypassing other property sources is expressly intended.
Calls to get(Object)
on the Map returned will never throw IllegalAccessException
;
in cases where the SecurityManager forbids access to a property, null
will be returned and an
INFO-level log message will be issued noting the exception.
Resolve ${...} placeholders in the given text, replacing them with corresponding
property values as resolved by getProperty(String)
. Unresolvable placeholders with
no default value are ignored and passed through unchanged.
text | the String to resolve |
---|
null
)Resolve ${...} placeholders in the given text, replacing them with corresponding
property values as resolved by getProperty(String)
. Unresolvable placeholders with
no default value will cause an IllegalArgumentException to be thrown.
null
)IllegalArgumentException |
---|
Specify the set of profiles active for this Environment. Profiles are evaluated during container bootstrap to determine whether bean definitions should be registered with the container.
Set the ConversionService
to be used when performing type
conversions on properties.
Specify the set of profiles to be made active by default if no other profiles
are explicitly made active through setActiveProfiles(String...)
.