java - 注解上的属性可以传递吗?
巴扎黑
巴扎黑 2017-04-18 10:47:16
0
2
520

Spring里@Component有一个value属性可以设置,MyComponentvalue可以传给@Component吗?

@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.TYPE})
@Component()
public @interface MyComponent {
    String value() default "";
}
巴扎黑
巴扎黑

reply all(2)
Ty80

This is more troublesome. It can be implemented through reflection.

PHPzhong

Annotations don’t seem to support inheritance

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template