private static Field [ ] getAllFieldsRec ( Class clazz , List < Field > fields ) { Class superClazz = clazz . getSuperclass ( ) ; if ( superClazz != null ) { getAllFieldsRec ( superClazz , fields ) ; } fields . addAll ( Arrays . asList ( clazz . getDeclaredFields ( ) ) ) ; return fields . toArray ( new Field [ fields . size ( ) ] ) ; }
Get all fields rec .