@Service(value="latticeSpringApplicationContextHolder") public class SpringApplicationContextHolder extends Object implements org.springframework.context.ApplicationContextAware
| 构造器和说明 |
|---|
SpringApplicationContextHolder() |
| 限定符和类型 | 方法和说明 |
|---|---|
static <T> T |
getSpringBean(@NonNull Class<?> beanClass)
get the spring bean via the Class.
|
static <T> T |
getSpringBean(String beanName)
get spring bean via name.
|
void |
setApplicationContext(@NotNull org.springframework.context.ApplicationContext context) |
public void setApplicationContext(@NotNull
@NotNull org.springframework.context.ApplicationContext context)
throws org.springframework.beans.BeansException
setApplicationContext 在接口中 org.springframework.context.ApplicationContextAwareorg.springframework.beans.BeansExceptionpublic static <T> T getSpringBean(String beanName)
T - the generic create the spring bean.beanName - the bean's name.public static <T> T getSpringBean(@NonNull
@NonNull Class<?> beanClass)
T - the generic type create the bean.beanClass - the bean class.Copyright © 2022. All rights reserved.