I am new to reflection and trying to create a generalized function which will take in object and parse all the fields that are of type String
, String[]
or List<String>
. Any String
, String[]
or List<String>
that is present in nested object has also to be parsed. Is there any utility which can help me in doing that? Getting the values from parent object (User
) was simple - used BeanUtils.describe(user);
- it gives the String
values in parent object but not String[]
, List<String>
and nested object. I am sure I might not be the first one who needs this feature? Are there any utilities or code which could help me achieve do this?
public class User {
private String somevalue;
private String[] thisArray;
private List<String> thisList;
private UserDefinedObject myObject;
.
.
.
}