private T extractKeyAndRow ( String timestamp , JSONObject jsonRow ) { T rowValues = null ; try { rowValues = rowMapper . newInstance ( ) ; rowValues . getClass ( ) . getMethod ( "setTimestamp" , String . class ) . invoke ( rowValues , timestamp ) ; for ( Object key : jsonRow . keySet ( ) ) { Util . applyKVToBean ( rowValues , key . toString ( ) , jsonRow . get ( key . toString ( ) ) ) ; } } catch ( InstantiationException | IllegalAccessException | NoSuchMethodException | SecurityException | IllegalArgumentException | InvocationTargetException ex ) { Logger . getLogger ( Mapper4Bean . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } return rowValues ; }
Extract v = all fields from json . The first field is always timestamp and is not extracted here .