public static Object getFieldValue ( Object obj , String name ) { Class < ? > clazz = obj . getClass ( ) ; try { Field f = clazz . getDeclaredField ( name ) ; return f . get ( obj ) ; } catch ( Exception e ) { return null ; } }
Get the value of a declared field on an object