List<GroupingRule> groupingRules = new ArrayList<GroupingRule>();
try {
JSONArray sortingRulesJson = new JSONArray(groupingRulesStr);
for (int i = 0, count = sortingRulesJson.length(); i < count; i++) {
JSONObject jsonObject = sortingRulesJson.getJSONObject(i);
groupingRules.add(new GroupingRule(jsonObject));
}
} catch (JSONException e) {
throw new RuntimeException(e);
}
rowGrouping.acceptNewGroupingRules(groupingRules);