I'm reading all fields values from an object and his children:
private List<Object> getAllFieldsValues(Class<?> clazz, String[] filter) throws IllegalArgumentException, IllegalAccessException {
List<Object> fieldsValues = new ArrayList<>();
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields) {
// some code
if (field.getType().isInterface()) {
// get all fields from a class which implements the interface
}
}
return fieldsValues;
}
I need to get all values from class which implements the interface. How?
Aucun commentaire:
Enregistrer un commentaire