Basic Issue
I want to inherit annotations so I can declare abstract classes including annotations for configuration. Then you only have to extend this abstract class and implement all abstract methods without configuring anything.
public class A {
}
@MyAnno
public class B extends A {
public abstract void foo();
}
public class C extends B {
public void foo() {
Magic.bar();
}
}
@Inherited
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface MyAnno {
}
But if I check with reflections, class C are not annotated with MyAnno. If I add @MyAnno
to class C, it works. This seems strange for me.
Jersey
In addition to my own annotations, I want to use Java RESTful Annotations like @GET
, @Path(""where/I/am)
and so on. This should work! But it doesn't and the subclass of the annotated superclass does not have ANY RESTful annotations or own annotations, nothing.