Spring里@Component有一个value属性可以设置,MyComponent的value可以传给@Component吗?
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
@Component()
public @interface MyComponent {
    String value() default "";
}Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
这个比较麻烦,实现起来可以通过反射实现。
注解貌似不支持继承