spring-framework / org.springframework.beans.factory.annotation / BeanFactoryAnnotationUtils

BeanFactoryAnnotationUtils

abstract class BeanFactoryAnnotationUtils

Convenience methods performing bean lookups related to annotations, for example Spring's Qualifier annotation.

Author
Juergen Hoeller

Author
Chris Beams

Since
3.1.2

See Also
BeanFactoryUtils

Constructors

<init>

BeanFactoryAnnotationUtils()

Convenience methods performing bean lookups related to annotations, for example Spring's Qualifier annotation.

Functions

isQualifierMatch

open static fun isQualifierMatch(qualifier: Predicate<String>, beanName: String, beanFactory: BeanFactory): Boolean

Check whether the named bean declares a qualifier of the given name.

qualifiedBeanOfType

open static fun <T : Any> qualifiedBeanOfType(beanFactory: BeanFactory, beanType: Class<T>, qualifier: String): T

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.