类 BeanFactoryUtils


  • public abstract class BeanFactoryUtils
    extends Object
    BeanFactory Utilities class
    另请参阅:
    BeanFactory, ConfigurableBeanFactory, BeanFactoryUtils
    • 构造器详细资料

      • BeanFactoryUtils

        public BeanFactoryUtils()
    • 方法详细资料

      • addApplicationListener

        public static boolean addApplicationListener(org.springframework.context.ApplicationContext applicationContext,
                                                     org.springframework.context.ApplicationListener listener)
      • getOptionalBean

        public static <T> T getOptionalBean(org.springframework.beans.factory.ListableBeanFactory beanFactory,
                                            String beanName,
                                            Class<T> beanType)
        Get optional Bean
        类型参数:
        T - the type of Bean
        参数:
        beanFactory - ListableBeanFactory
        beanName - the name of Bean
        beanType - the type of Bean
        返回:
        A bean if present , or null
        从以下版本开始:
        2.6.6
      • getBeans

        public static <T> List<T> getBeans(org.springframework.beans.factory.ListableBeanFactory beanFactory,
                                           String[] beanNames,
                                           Class<T> beanType)
        Gets name-matched Beans from BeanFactory
        类型参数:
        T - the type of Bean
        参数:
        beanFactory - BeanFactory
        beanNames - the names of Bean
        beanType - the type of Bean
        返回:
        the read-only and non-null List of Bean names
        从以下版本开始:
        2.6.6