Annotation Interface ConditionalOnMissingQualifiedBean


@Target({TYPE,METHOD}) @Retention(RUNTIME) @Documented @Conditional(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.

Author:
Steven van Beelen
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The qualifier which all instances of the given {code beanClass} in the ApplicationContext will be matched for.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The class type of bean that should be checked.
  • Element Details

    • beanClass

      Class<?> beanClass
      The class type of bean that should be checked. The condition matches if the class specified is contained in the ApplicationContext, together with the specified qualifier.
      Default:
      java.lang.Object.class
    • qualifier

      String qualifier
      The qualifier which all instances of the given {code beanClass} in the 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.