public class NullContextManager extends Object implements ContextManager
| 构造器和说明 |
|---|
NullContextManager() |
| 限定符和类型 | 方法和说明 |
|---|---|
<T> T |
getBean(Class<T> clazz)
Retrieves a bean by its class type.
|
<T> T |
getBean(String name,
Class<T> clazz)
Retrieves a bean by its name and class type.
|
<T> Map<String,T> |
getBeansOfType(Class<T> clazz)
Retrieves all beans of the specified type.
|
Object |
getEnvironment()
Retrieves the environment.
|
String |
getEnvironmentProperty(String key)
Retrieves an environment property by its key.
|
String |
getEnvironmentProperty(String key,
Object environment)
Retrieves an environment property by its key in the specified environment.
|
String |
getEnvironmentProperty(String key,
String defaultValue)
Retrieves an environment property by its key, with a default value.
|
public <T> T getBean(Class<T> clazz)
ContextManagergetBean 在接口中 ContextManagerT - the type of the beanclazz - the class of the beanpublic <T> T getBean(String name, Class<T> clazz)
ContextManagergetBean 在接口中 ContextManagerT - the type of the beanname - the name of the beanclazz - the class of the beanpublic <T> Map<String,T> getBeansOfType(Class<T> clazz)
ContextManagergetBeansOfType 在接口中 ContextManagerT - the type of the beansclazz - the class of the beanspublic Object getEnvironment()
ContextManagergetEnvironment 在接口中 ContextManagerpublic String getEnvironmentProperty(String key)
ContextManagergetEnvironmentProperty 在接口中 ContextManagerkey - the key of the propertypublic String getEnvironmentProperty(String key, Object environment)
ContextManagergetEnvironmentProperty 在接口中 ContextManagerkey - the key of the propertyenvironment - the specified environment objectpublic String getEnvironmentProperty(String key, String defaultValue)
ContextManagergetEnvironmentProperty 在接口中 ContextManagerkey - the key of the propertydefaultValue - the default value to return if the property is not foundCopyright © 2025. All rights reserved.