如何获取覆盖的方法的注释对象。
/* I created a custom annotation named AclIgnore,
and I have the next following piece of code: */
public class abstract Parent{
@AclIgnore
public abstract String getName();
}
public class Children extends Parent{
@Override
public String getName(){
return "theChildren";
}
}
/*I want the AclIgnore of Parent.getName() but the next code returns null */
/*method is getName of the instance*/
AclIgnore aclIgnore = method.getAnnotation(AclIgnore.class);
我的问题是:当我有一个AclIgnore
实例引用孩子的方法时,是否可以从父类中获取java.lang.reflect.Method
注释?