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号
这个比较麻烦,实现起来可以通过反射实现。
注解貌似不支持继承