Hi. I noticed that a method to return the field type was missing on FieldAccess, so i decided to fork your project and i implemented it. I also implemented a method to return the field count. This is very useful to iterate all fields for the same object instance.
If you would like to see the changes, please check here:
ReflectASM-fork-gabrikidWould you like to merge my changes into your project?
By the way, i want to
suggest something more. The sample source codes that you have at README.md are useful to manage the same field/method on different instances. But if you want to iterate all fields/methods on the same instance, and if you use
exactly that source code, you will never get the maximum performance. So, i suggest you to add some more sample codes like this one:
FieldAccess access = FieldAccess.get(SomeClass.class);
String[] fieldNames = access.getFieldNames();
for(int i = 0; i < fieldNames.length; i++) {
access.set(instanceObject, i, valueToPut);
}
}
(with my changes, note the getFieldCount() call to perform the iteration)
FieldAccess access = FieldAccess.get(SomeClass.class);
for(int i = 0; i < access.getFieldCount(); i++) {
access.set(instanceObject, i, valueToPut);
}
}