Closed
Description
Yanming Zhou opened SPR-16066 and commented
@Service
is a specialization of @Component
, like @GetMapping
is a specialization of @RequestMapping
, @Service
should add @AliasFor
like @GetMapping
@Component
public @interface Service
{
@AliasFor(annotation=Component.class)
String value() default "";
}
We can get metadata from annotation via unified code
Component component = AnnotatedElementUtils.getMergedAnnotation(clazz, @Component.class);
String beanName = component.value();