public class StandardEnvironment extends java.lang.Object implements ConfigurableEnvironment
Environment| 构造器和说明 |
|---|
StandardEnvironment() |
| 限定符和类型 | 方法和说明 |
|---|---|
boolean |
acceptsProfiles(java.lang.String... profiles)
If active profiles is empty return false.
|
void |
addActiveProfile(java.lang.String profile)
Add a profile to the current set of active profiles.
|
boolean |
containsProperty(java.lang.String key)
Return whether the given property key is available for resolution
|
java.lang.String[] |
getActiveProfiles()
Return the set of profiles explicitly made active for this environment.
|
BeanDefinitionLoader |
getBeanDefinitionLoader()
Get bean definition loader
|
BeanDefinitionRegistry |
getBeanDefinitionRegistry()
Get the bean definition registry
|
BeanNameCreator |
getBeanNameCreator()
Get a bean name creator
|
java.util.Properties |
getProperties()
Get properties
|
java.lang.String |
getProperty(java.lang.String key)
Return the property value associated with the given key, or
null if
the key cannot be resolved. |
<T> T |
getProperty(java.lang.String key,
java.lang.Class<T> targetType)
Return the property value associated with the given key, or
null if
the key cannot be resolved. |
java.lang.String |
getProperty(java.lang.String key,
java.lang.String defaultValue)
Return the property value associated with the given key, or
defaultValue if the key cannot be resolved. |
void |
loadProperties(java.lang.String properties)
Load properties file with given path
|
void |
setActiveProfiles(java.lang.String... profiles)
Specify the set of profiles active for this
Environment |
ConfigurableEnvironment |
setBeanDefinitionLoader(BeanDefinitionLoader beanDefinitionLoader)
set bean definition loader
|
ConfigurableEnvironment |
setBeanDefinitionRegistry(BeanDefinitionRegistry beanDefinitionRegistry)
Set the bean definition registry
|
ConfigurableEnvironment |
setBeanNameCreator(BeanNameCreator beanNameCreator) |
void |
setProperty(java.lang.String key,
java.lang.String value)
Set
Environment property |
public java.util.Properties getProperties()
EnvironmentgetProperties 在接口中 Environmentpublic boolean containsProperty(java.lang.String key)
EnvironmentcontainsProperty 在接口中 Environmentkey - keypublic java.lang.String getProperty(java.lang.String key)
Environmentnull if
the key cannot be resolved.getProperty 在接口中 Environmentkey - the property name to resolvepublic java.lang.String getProperty(java.lang.String key,
java.lang.String defaultValue)
EnvironmentdefaultValue if the key cannot be resolved.getProperty 在接口中 Environmentkey - the property name to resolvedefaultValue - the default value to return if no value is founddefaultValue if the key cannot be resolved.public <T> T getProperty(java.lang.String key,
java.lang.Class<T> targetType)
Environmentnull if
the key cannot be resolved.getProperty 在接口中 Environmentkey - the property name to resolvetargetType - the expected type of the property valuenull if
the key cannot be resolvedpublic BeanDefinitionRegistry getBeanDefinitionRegistry()
EnvironmentgetBeanDefinitionRegistry 在接口中 EnvironmentBeanDefinitionRegistrypublic BeanDefinitionLoader getBeanDefinitionLoader()
EnvironmentgetBeanDefinitionLoader 在接口中 EnvironmentBeanDefinitionLoaderpublic java.lang.String[] getActiveProfiles()
EnvironmentgetActiveProfiles 在接口中 Environmentpublic void setActiveProfiles(java.lang.String... profiles)
ConfigurableEnvironmentEnvironmentsetActiveProfiles 在接口中 ConfigurableEnvironmentprofiles - Setting active profilespublic void setProperty(java.lang.String key,
java.lang.String value)
ConfigurableEnvironmentEnvironment propertysetProperty 在接口中 ConfigurableEnvironmentkey - keyvalue - valuepublic void addActiveProfile(java.lang.String profile)
ConfigurableEnvironmentaddActiveProfile 在接口中 ConfigurableEnvironmentprofile - add a active profilepublic void loadProperties(java.lang.String properties)
throws java.io.IOException
loadProperties 在接口中 ConfigurableEnvironmentproperties - properties directoryjava.io.IOException - when could not access to a properties filepublic ConfigurableEnvironment setBeanDefinitionRegistry(BeanDefinitionRegistry beanDefinitionRegistry)
ConfigurableEnvironmentsetBeanDefinitionRegistry 在接口中 ConfigurableEnvironmentbeanDefinitionRegistry - BeanDefinitionRegistry instanceConfigurableEnvironmentpublic ConfigurableEnvironment setBeanDefinitionLoader(BeanDefinitionLoader beanDefinitionLoader)
ConfigurableEnvironmentsetBeanDefinitionLoader 在接口中 ConfigurableEnvironmentbeanDefinitionLoader - BeanDefinitionLoader instanceConfigurableEnvironmentpublic boolean acceptsProfiles(java.lang.String... profiles)
EnvironmentacceptsProfiles 在接口中 Environmentprofiles - profilespublic ConfigurableEnvironment setBeanNameCreator(BeanNameCreator beanNameCreator)
setBeanNameCreator 在接口中 ConfigurableEnvironmentbeanNameCreator - BeanNameCreator instanceConfigurableEnvironmentpublic BeanNameCreator getBeanNameCreator()
EnvironmentgetBeanNameCreator 在接口中 EnvironmentBeanNameCreatorCopyright © 2019 TODAY. All rights reserved.