public String toString() {
return "propertyInjection(" + getter + ", " + setter + ")";
}
+
+ @Override
+ public Class<T> getType() {
+ return (Class<T>)getter.getReturnType();
+ }
}
\ No newline at end of file
List<Accessor> accessors = AnnotationUtils.analyse(X1.class, MyAnnotation.class);
assertEquals(1, accessors.size());
assertTrue(accessors.get(0) instanceof FieldAccessor);
+ assertEquals(int.class, accessors.get(0).getType());
X1 obj = new X1();
assertEquals(0, obj.x);
List<Accessor> accessors = AnnotationUtils.analyse(X3.class, MyAnnotation.class);
assertEquals(1, accessors.size());
assertTrue(accessors.get(0) instanceof PropertyAccessor);
+ assertEquals(int.class, accessors.get(0).getType());
X3 obj = new X3();
assertEquals(0, obj.x);
accessors.get(0).set(obj, 100);