com.alibaba.dubbo.config.spring.util
Class BeanFactoryUtils
java.lang.Object
com.alibaba.dubbo.config.spring.util.BeanFactoryUtils
public class BeanFactoryUtils
- extends Object
BeanFactory Utilities class
- Since:
- 2.5.7
- Author:
- Mercy
- See Also:
BeanFactory,
ConfigurableBeanFactory,
BeanFactoryUtils
|
Method Summary |
static
|
getBeans(org.springframework.beans.factory.ListableBeanFactory beanFactory,
String[] beanNames,
Class<T> beanType)
Gets name-matched Beans from BeanFactory |
static
|
getOptionalBean(org.springframework.beans.factory.ListableBeanFactory beanFactory,
String beanName,
Class<T> beanType)
Get optional Bean |
BeanFactoryUtils
public BeanFactoryUtils()
getOptionalBean
public static <T> T getOptionalBean(org.springframework.beans.factory.ListableBeanFactory beanFactory,
String beanName,
Class<T> beanType)
- Get optional Bean
- Type Parameters:
T - the type of Bean- Parameters:
beanFactory - ListableBeanFactorybeanName - the name of BeanbeanType - the type of Bean
- Returns:
- A bean if present , or
null
getBeans
public static <T> List<T> getBeans(org.springframework.beans.factory.ListableBeanFactory beanFactory,
String[] beanNames,
Class<T> beanType)
- Gets name-matched Beans from
BeanFactory
- Type Parameters:
T - the type of Bean- Parameters:
beanFactory - BeanFactorybeanNames - the names of BeanbeanType - the type of Bean
- Returns:
Copyright © 2012–2017 Alibaba. All rights reserved.