Annotation Interface ConditionalOnQualifiedBean
@Target({TYPE,METHOD})
@Retention(RUNTIME)
@Documented
@Conditional(OnQualifiedBeanCondition.class)
public @interface ConditionalOnQualifiedBean
Conditional that only matches when for the specified bean class in the BeanFactory there is an
instance which has the given qualifier set on it.
The condition can only match the bean definitions that have been processed by the application context so far and, as such, it is strongly recommended to use this condition on auto-configuration classes only. If a candidate bean may be created by another auto-configuration, make sure that the one using this condition runs after.
- Author:
- Steven van Beelen
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional Elements
-
Element Details
-
beanClass
Class<?> beanClassThe class type of bean that should be checked. The condition matches if the class specified is contained in theApplicationContext, together with the specifiedqualifier.- Default:
java.lang.Object.class
-
qualifier
String qualifierThe qualifier which all instances of the given {code beanClass} in theApplicationContextwill be matched for. One may indicate that a qualifier should not be present by prefixing it with!, e.g:qualifier = "!unqualified".Multiple qualifiers may be provided, separated with a comma (
,). In that case, a bean matches when it is assigned one of the given qualifiers.
-