@Target(value={TYPE,METHOD}) @Retention(value=RUNTIME) @Documented @Conditional(value=OnMissingQualifiedBeanCondition.class) public @interface ConditionalOnMissingQualifiedBean
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.
public abstract String qualifier
ApplicationContext
will 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.
public abstract Class<?> beanClass
ApplicationContext
, together with the specified qualifier
.Copyright © 2010–2023. All rights reserved.