e.printStackTrace();
}
return objs;
}
public static List jsonToObjs(String json, Class cls) {
return jsonToObjs(json, cls, false, dateFormat);
}
4.2 未完整的MapTableData.java,开始创建新表格
/**
-
创建Map表格数据
-
@param tableName 表格名
-
@param mapList Map数组
*/
public static MapTableData create(String tableName, List mapList,String classity) {
return create(tableName, mapList, null,classity);
}
/**
-
创建Map表格数据
-
@param tableName 表格名
-
@param mapList Map数组
-
@param keyFormat map中key格式化
*/
public static MapTableData create(String tableName, List mapList, IFormat keyFormat,String classity) {
if (mapList != null) {
List columns = new ArrayList<>();
getMapColumn(columns, Column.INVAL_VALUE, Column.INVAL_VALUE, mapList, keyFormat);
if(classity!=null&&!classity.isEmpty()){
//根据classity 设置表头
columns = getNewColumn(columns,classity);
}
return new MapTableData(tableName, mapList, columns);
}
return null;
}
private static List getNewColumn(List