类 StandardEnvironment
- 所有已实现的接口:
ConfigurableEnvironment,ConfigurablePropertyResolver,Environment,IterablePropertyResolver,PropertyResolver,Iterable<String>
Environment implementation suitable for use in 'standard' (i.e. non-web)
applications.
In addition to the usual functions of a ConfigurableEnvironment such as
property resolution and profile-related operations, this implementation configures two
default property sources, to be searched in the following order:
environment.getProperty("xyz").
This ordering is chosen by default because system properties are per-JVM, while
environment variables may be the same across many JVMs on a given system. Giving
system properties precedence allows for overriding of environment variables on a
per-JVM basis.
These default property sources may be removed, reordered, or replaced; and
additional property sources may be added using the PropertySources
instance available from AbstractEnvironment.getPropertySources(). See
ConfigurableEnvironment Javadoc for usage examples.
See SystemEnvironmentPropertySource javadoc for details on special handling
of property names in shell environments (e.g. Bash) that disallow period characters in
variable names.
- 从以下版本开始:
- 4.0
- 作者:
- Chris Beams
- 另请参阅:
-
字段概要
字段修饰符和类型字段说明static final StringSystem environment property source name: "systemEnvironment".static final StringJVM system properties property source name: "systemProperties".从接口继承的字段 cn.taketoday.core.env.Environment
DEFAULT_PROFILE, ENVIRONMENT_BEAN_NAME, KEY_ACTIVE_PROFILES, KEY_DEFAULT_PROFILES, KEY_IGNORE_GETENV, SYSTEM_ENVIRONMENT_BEAN_NAME, SYSTEM_PROPERTIES_BEAN_NAME -
构造器概要
构造器限定符构造器说明Create a newStandardEnvironmentinstance.protectedStandardEnvironment(PropertySources propertySources) Create a newStandardEnvironmentinstance with a specificPropertySourcesinstance. -
方法概要
修饰符和类型方法说明protected voidcustomizePropertySources(PropertySources propertySources) Customize the set of property sources with those appropriate for any standard Java environment: "systemProperties" "systemEnvironment"从类继承的方法 cn.taketoday.core.env.AbstractEnvironment
acceptsProfiles, addActiveProfile, addRequiredProperties, containsProperty, createPropertyResolver, doGetActiveProfiles, doGetActiveProfilesProperty, doGetDefaultProfiles, doGetDefaultProfilesProperty, getActiveProfiles, getConversionService, getDefaultProfiles, getProperty, getProperty, getProperty, getProperty, getPropertyResolver, getPropertySources, getRequiredProperty, getRequiredProperty, getReservedDefaultProfiles, getSystemEnvironment, getSystemProperties, isProfileActive, iterator, merge, resolvePlaceholders, resolveRequiredPlaceholders, setActiveProfiles, setConversionService, setDefaultProfiles, setIgnoreUnresolvableNestedPlaceholders, setPlaceholderPrefix, setPlaceholderSuffix, setRequiredProperties, setValueSeparator, suppressGetenvAccess, toString, validateProfile, validateRequiredProperties从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 cn.taketoday.core.env.Environment
matchesProfiles从接口继承的方法 java.lang.Iterable
forEach, spliterator从接口继承的方法 cn.taketoday.core.env.PropertyResolver
getFlag, getFlag
-
字段详细资料
-
构造器详细资料
-
StandardEnvironment
public StandardEnvironment()Create a newStandardEnvironmentinstance. -
StandardEnvironment
Create a newStandardEnvironmentinstance with a specificPropertySourcesinstance.- 参数:
propertySources- property sources to use
-
-
方法详细资料
-
customizePropertySources
Customize the set of property sources with those appropriate for any standard Java environment:Properties present in "systemProperties" will take precedence over those in "systemEnvironment".
-