lundi 13 avril 2015

Get field value in java via reflection

How do I get the field value in java via reflection?



Class<?> clazz = someObject.getClass();
Field[] fields = clazz.getDeclaredFields();
for (Field field : fields)
{
String fieldName=field.getName();
var fieldValue=??

}





Aucun commentaire:

Enregistrer un commentaire