Annotation Interface Role


@Documented @Target({TYPE,METHOD}) @Retention(RUNTIME) public @interface Role
Indicates the 'role' hint for a given bean.

May be used on any class directly or indirectly annotated with Component

If this annotation is not present on a Component or Bean definition, the default value of BeanDefinition.ROLE_APPLICATION will apply.

If Role is present on a @Configuration class, this indicates the role of the configuration class bean definition and does not cascade to all @Bean methods defined within. This behavior is different than that of the @Lazy annotation, for example.

从以下版本开始:
4.0
作者:
Chris Beams, Harry Yang 2021/10/14 14:26
另请参阅:
  • 必需元素概要

    所需元素
    修饰符和类型
    必需的元素
    说明
    int
    Set the role hint for the associated bean.