注释中的Java注释问题

时间:2017-07-20 06:18:50

标签: java annotations

嗨,大家好像有点像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(){
  }
}

这可能吗?

1 个答案:

答案 0 :(得分:0)