java – 删除子类中的注释?
我有一个子类,需要一个注释,在父类中删除.做这个的最好方式是什么?
public class Parent
@MyAnnoation
String foobar;
}
public class Child extends Parent {
//here I only want to remove the @MyAnnotation from String foobar;
}
我想要避免的是,“覆盖”该成员
public class Child extends Parent {
String foobar;
}
因为它有几个缺点(因为它“覆盖”底层父成员= this.foobar可能与super.foobar不同)…
1.)是否有一种简单的方法可以从子类(此处是Child)中的父类中删除注释?
2.)删除子类中的注释的官方方法是什么?
非常感谢!马库斯