com.alibaba.dubbo.config.spring.util
Class BeanFactoryUtils

java.lang.Object
  extended by 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

Constructor Summary
BeanFactoryUtils()
           
 
Method Summary
static
<T> List<T>
getBeans(org.springframework.beans.factory.ListableBeanFactory beanFactory, String[] beanNames, Class<T> beanType)
          Gets name-matched Beans from BeanFactory
static
<T> T
getOptionalBean(org.springframework.beans.factory.ListableBeanFactory beanFactory, String beanName, Class<T> beanType)
          Get optional Bean
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanFactoryUtils

public BeanFactoryUtils()
Method Detail

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 - ListableBeanFactory
beanName - the name of Bean
beanType - 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 - BeanFactory
beanNames - the names of Bean
beanType - the type of Bean
Returns:


Copyright © 2012–2017 Alibaba. All rights reserved.