I can not get annotations of beans, i'm working with spring framework:
Runnable test class:
public class Main {
public static void main(String[] args) {
PropertyDescriptor pd = BeanUtils.getPropertyDescriptor(Test.class,"foo");
Method m=pd.getReadMethod();
System.out.println(m.isAnnotationPresent(Annot.class));
}
}
Bean class;
public class Test {
private String foo;
@Annot
public String getFoo() {
return foo;
}
public void setFoo(String foo) {
this.foo = foo;
}
}
Annotation class:
public @interface Annot {
}
The main class get "false" as output... why?