org.springframework.beans.factory.annotation

## 类 BeanFactoryAnnotationUtils

- java.lang.Object
- - org.springframework.beans.factory.annotation.BeanFactoryAnnotationUtils

-     public abstract class BeanFactoryAnnotationUtils
      extends Object

  Convenience methods performing bean lookups related to Spring-specific annotations, for example Spring's `@Qualifier` annotation.
  从以下版本开始:
    3.1.2
  作者:
    Juergen Hoeller, Chris Beams
  另请参阅:
    `BeanFactoryUtils`

- - ### 构造器概要

    构造器
    构造器和说明
    `BeanFactoryAnnotationUtils()`

  - ### 方法概要

    所有方法 静态方法 具体方法
    限定符和类型 | 方法和说明
    --- | ---
    `static boolean` | `isQualifierMatch(Predicate<String> qualifier, String beanName, BeanFactory beanFactory)` Check whether the named bean declares a qualifier of the given name.
    `static <T> T` | `qualifiedBeanOfType(BeanFactory beanFactory, Class<T> beanType, String qualifier)` Obtain a bean of type `T` from the given `BeanFactory` declaring a qualifier (e.g. via `<qualifier>` or `@Qualifier`) matching the given qualifier, or having a bean name matching the given qualifier.

    - ### 从类继承的方法 java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 构造器详细资料

    - #### BeanFactoryAnnotationUtils

          public BeanFactoryAnnotationUtils()

  - ### 方法详细资料

    - #### qualifiedBeanOfType

          public static <T> T qualifiedBeanOfType(BeanFactory beanFactory,
                                                  Class<T> beanType,
                                                  String qualifier)
                                           throws BeansException

      Obtain a bean of type `T` from the given `BeanFactory` declaring a qualifier (e.g. via `<qualifier>` or `@Qualifier`) matching the given qualifier, or having a bean name matching the given qualifier.
      参数:
        `beanFactory` - the factory to get the target bean from (also searching ancestors)
        `beanType` - the type of bean to retrieve
        `qualifier` - the qualifier for selecting between multiple bean matches
      返回:
        the matching bean of type `T` (never `null`)
      抛出:
        `NoUniqueBeanDefinitionException` - if multiple matching beans of type `T` found
        `NoSuchBeanDefinitionException` - if no matching bean of type `T` found
        `BeansException` - if the bean could not be created
      另请参阅:
        `BeanFactoryUtils.beanOfTypeIncludingAncestors(ListableBeanFactory, Class)`

    - #### isQualifierMatch

          public static boolean isQualifierMatch(Predicate<String> qualifier,
                                                 String beanName,
                                                 @Nullable
                                                 BeanFactory beanFactory)

      Check whether the named bean declares a qualifier of the given name.
      参数:
        `qualifier` - the qualifier to match
        `beanName` - the name of the candidate bean
        `beanFactory` - the factory from which to retrieve the named bean
      返回:
        `true` if either the bean definition (in the XML case) or the bean's factory method (in the `@Bean` case) defines a matching qualifier value (through `<qualifier>` or `@Qualifier`)
      从以下版本开始:
        5.0