private JSONArray serializeMeasures(CrosstabDefinition crosstabDefinition) throws JSONException {
List<Measure> measures = crosstabDefinition.getMeasures();
JSONArray toReturn = new JSONArray();
for (int i = 0; i < measures.size(); i++) {
Measure measure = measures.get(i);
JSONObject obj = new JSONObject();
obj.put(CrosstabSerializationConstants.ID, measure.getEntityId());
obj.put(CrosstabSerializationConstants.ALIAS, measure.getAlias());
obj.put(CrosstabSerializationConstants.ICON_CLS, measure.getIconCls());
obj.put(CrosstabSerializationConstants.NATURE, measure.getNature());
obj.put(CrosstabSerializationConstants.FUNCTION, measure.getAggregationFunction().getName());
toReturn.put(obj);
}
return toReturn;
}