A Technology Blog About Code Development, Architecture, Operating System, Hardware, Tips and Tutorials for Developers.

Wednesday, October 19, 2016


6:47:00 PM Posted by Satish Kumar No comments
Spring has a nice Utility class ReflectionUtils that does just that: it defines a method to loop over all fields of all super classes with a callback: ReflectionUtils.doWithFields()

Invoke the given callback on all fields in the target class, going up the class hierarchy to get all declared fields.

- clazz - the target class to analyze
- fc - the callback to invoke for each field
- ff - the filter that determines the fields to apply the callback to

Sample Code:

Found field private int java.util.ArrayList.size in type class java.util.ArrayList


Post a Comment