注释类型 Role
@Target({TYPE,METHOD}) @Retention(RUNTIME) @Documented public @interface Role
Indicates the 'role' hint for a given bean.May be used on any class directly or indirectly annotated with
Componentor on methods annotated withBean.If this annotation is not present on a Component or Bean definition, the default value of
BeanDefinition.ROLE_APPLICATIONwill apply.If Role is present on a
@Configurationclass, this indicates the role of the configuration class bean definition and does not cascade to all @Beanmethods defined within. This behavior is different than that of the @Lazyannotation, for example.- 从以下版本开始:
- 3.1
- 作者:
- Chris Beams
- 另请参阅:
BeanDefinition.ROLE_APPLICATION,BeanDefinition.ROLE_INFRASTRUCTURE,BeanDefinition.ROLE_SUPPORT,Bean
必需元素概要
所需元素 修饰符和类型 必需的元素 说明 intvalueSet the role hint for the associated bean.
元素详细资料
value
int value
Set the role hint for the associated bean.