类 BeanFactoryUtils


  • public abstract class BeanFactoryUtils
    extends 
    BeanFactory Utilities class
    另请参阅:
    BeanFactory, ConfigurableBeanFactory, BeanFactoryUtils
    • 方法概要

      所有方法 静态方法 具体方法 
      修饰符和类型 方法 说明
      static boolean addApplicationListener​(org.springframework.context.ApplicationContext applicationContext, org.springframework.context.ApplicationListener listener)  
      static <T> <T> getBeans​(org.springframework.beans.factory.ListableBeanFactory beanFactory, [] beanNames, <T> beanType)
      Gets name-matched Beans from BeanFactory
      static <T> T getOptionalBean​(org.springframework.beans.factory.ListableBeanFactory beanFactory,  beanName, <T> beanType)
      Get optional Bean
      • 从类继承的方法 java.lang.

        , , , , , , , ,
    • 构造器详细资料

      • 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,
                                             beanName,
                                            <T> beanType)
        Get optional Bean
        类型参数:
        T - the of Bean
        参数:
        beanFactory - ListableBeanFactory
        beanName - the name of Bean
        beanType - the of Bean
        返回:
        A bean if present , or null
        从以下版本开始:
        2.6.6
      • getBeans

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