Annotation Type ConditionalOnMissingBean


@Retention(CLASS) @Target({TYPE,METHOD}) public @interface ConditionalOnMissingBean

Constructs this bean only when no other bean has its type.

Decided entirely by the build, which sees every bean: a default implementation marked with this steps aside for one the application declares.

Without value, "its type" is every type the bean can be injected as other than the JDK's own -- the class and its interfaces -- so a DefaultMailer implements Mailer steps aside for any other Mailer bean.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Class<?>[]
    The types whose presence makes this bean step aside, when the default set is too wide or too narrow.
  • Element Details

    • value

      Class<?>[] value
      The types whose presence makes this bean step aside, when the default set is too wide or too narrow.
      Default:
      {}