private Object convertTabularDataDirectly ( TabularData pTd , Stack < String > pExtraArgs , ObjectToJsonConverter pConverter ) throws AttributeNotFoundException { if ( ! pExtraArgs . empty ( ) ) { throw new IllegalArgumentException ( "Cannot use a path for converting tabular data with complex keys (" + pTd . getTabularType ( ) . getRowType ( ) + ")" ) ; } JSONObject ret = new JSONObject ( ) ; JSONArray indexNames = new JSONArray ( ) ; TabularType type = pTd . getTabularType ( ) ; for ( String index : type . getIndexNames ( ) ) { indexNames . add ( index ) ; } ret . put ( "indexNames" , indexNames ) ; JSONArray values = new JSONArray ( ) ; // Here no special handling for wildcard pathes since pathes are not supported for this use case (yet) for ( CompositeData cd : ( Collection < CompositeData > ) pTd . values ( ) ) { values . add ( pConverter . extractObject ( cd , pExtraArgs , true ) ) ; } ret . put ( "values" , values ) ; return ret ; }
Convert to a direct representation of the tabular data