public interface ContextManager
| 限定符和类型 | 方法和说明 |
|---|---|
<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.
|
<T> T getBean(Class<T> clazz)
T - the type of the beanclazz - the class of the bean<T> T getBean(String name, Class<T> clazz)
T - the type of the beanname - the name of the beanclazz - the class of the bean<T> Map<String,T> getBeansOfType(Class<T> clazz)
T - the type of the beansclazz - the class of the beansObject getEnvironment()
String getEnvironmentProperty(String key)
key - the key of the propertyString getEnvironmentProperty(String key, Object environment)
key - the key of the propertyenvironment - the specified environment objectString getEnvironmentProperty(String key, String defaultValue)
key - the key of the propertydefaultValue - the default value to return if the property is not foundCopyright © 2025. All rights reserved.