Annotation Interface MissingBean


Context will create a bean definition when current context were missing
从以下版本开始:
2019-01-31 14:36
作者:
Harry Yang
  • 可选元素概要

    可选元素
    修饰符和类型
    可选元素
    说明
    Class<? extends Annotation>[]
    The annotation type decorating a bean that should be checked.
    Class<?>[]
    The class types of beans that should be ignored when identifying matching beans.
    The class type names of beans that should be ignored when identifying matching beans.
    Missing bean name
    Class<?>[]
    Additional classes that may contain the specified bean types within their generic parameters.
    Strategy to decide if the application context hierarchy (parent contexts) should be considered.
    The class type names of beans that should be checked.
    Class<?>[]
    The class types of beans that should be checked.
  • 元素详细资料

    • value

      @AliasFor(annotation=ConditionalOnMissingBean.class, attribute="value") Class<?>[] value
      The class types of beans that should be checked. The condition matches when no bean of each class specified is contained in the BeanFactory.
      返回:
      the class types of beans to check
      默认值:
      {}
    • name

      @AliasFor(annotation=ConditionalOnMissingBean.class, attribute="name") String[] name
      Missing bean name

      this attr determine the bean definition

      when its declare on a method default bean name is method-name

      默认值:
      {}
    • type

      @AliasFor(annotation=ConditionalOnMissingBean.class, attribute="type") String[] type
      The class type names of beans that should be checked. The condition matches when no bean of each class specified is contained in the BeanFactory.
      返回:
      the class type names of beans to check
      默认值:
      {}
    • ignored

      @AliasFor(annotation=ConditionalOnMissingBean.class, attribute="ignored") Class<?>[] ignored
      The class types of beans that should be ignored when identifying matching beans.
      返回:
      the class types of beans to ignore
      默认值:
      {}
    • ignoredType

      @AliasFor(annotation=ConditionalOnMissingBean.class, attribute="ignoredType") String[] ignoredType
      The class type names of beans that should be ignored when identifying matching beans.
      返回:
      the class type names of beans to ignore
      默认值:
      {}
    • annotation

      @AliasFor(annotation=ConditionalOnMissingBean.class, attribute="annotation") Class<? extends Annotation>[] annotation
      The annotation type decorating a bean that should be checked. The condition matches when each annotation specified is missing from all beans in the BeanFactory.
      返回:
      the class-level annotation types to check
      默认值:
      {}
    • search

      @AliasFor(annotation=ConditionalOnMissingBean.class, attribute="search") SearchStrategy search
      Strategy to decide if the application context hierarchy (parent contexts) should be considered.
      返回:
      the search strategy
      默认值:
      ALL
    • parameterizedContainer

      @AliasFor(annotation=ConditionalOnMissingBean.class, attribute="parameterizedContainer") Class<?>[] parameterizedContainer
      Additional classes that may contain the specified bean types within their generic parameters. For example, an annotation declaring value=Name.class and parameterizedContainer=NameRegistration.class would detect both Name and NameRegistration<Name>.
      返回:
      the container types
      默认值:
      {}