我有一个接口我和抽象类一,我有我的自定义注解MyAnnotation 应采取参数作为子类小号的一个,现在在处理注释我想打电话给具体类的方法小号
public interface I{
void m1();
}
public abstract class A implements I {
public abstract void m1();
}
public @interface MyAnnotation {
public Class< ? extends A> ref();
public Class< ? super A> ref2();
}
public S extends A{
public void m1() {}
}
我正在注释方法,例如
@MyAnnotation(ref= new XX() ) or @MyAnnotation(ref= XX.class )
@MyAnnotation(ref= new yy() ) or @MyAnnotation(ref= yy.class )
无论哪个有效
//In spring aspect before processing I am getting method annotation and trying to call m1()
annotation.ref().m1() //Error
annotation.ref2().m1() //Error
白衣染霜花
慕婉清6462132
相关分类