有没有办法在注释方法中设置id
...
注释类:
import java.lang.annotation.*;
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.METHOD)
public
@interface MyAnnotation {
int id();
}
//Set id at runtime
public class A {
@MyAnnotation(id = ? )
public void method1() {
// I want to set the id here for my annotation...
}
}