嗨,大家好像有点像java中允许的那样:
@Retention(RetentionPolicy.RUNTIME)
@Target(METHOD)
@FirstAnno
public @interface Test1 {
Test2 t();
@SecondAnno
public @interface Test2 {
// also has @FirstAnno
}
}
稍后我会这样使用它;
class MyClass {
@Test1.Test2 // or something like this
public String getData(){
}
}
这可能吗?
答案 0 :(得分:0)