}
return null;
}
public static Object parseElementFromJsonObject(JSONObject obj) throws Exception {
DataList object = (DataList) new DataList();
if (object != null) {
if (obj.has(PROPERTY_ID)) {
object.setId(obj.getString(PROPERTY_ID));
}
if (obj.has(PROPERTY_NAME)) {
object.setName(obj.getString(PROPERTY_NAME));
}
if (obj.has(PROPERTY_DESC)) {
object.setDescription(obj.getString(PROPERTY_DESC));
}
if (obj.has(PROPERTY_PAGE_SIZE)) {
object.setDefaultPageSize(obj.getInt(PROPERTY_PAGE_SIZE));
}
if (obj.has(PROPERTY_ORDER)) {
object.setDefaultOrder(obj.getString(PROPERTY_ORDER));
}
if (obj.has(PROPERTY_ORDER_BY)) {
object.setDefaultSortColumn(obj.getString(PROPERTY_ORDER_BY));
}
//set columns
Collection<DataListColumn> columns = parseColumnsFromJsonObject(obj);
DataListColumn[] temp = (DataListColumn[]) columns.toArray(new DataListColumn[columns.size()]);
object.setColumns(temp);
//set binder
DataListBinder binder = parseBinderFromJsonObject(obj);
object.setBinder(binder);
//set actions
Collection<DataListAction> actions = parseActionsFromJsonObject(obj);
DataListAction[] temp2 = (DataListAction[]) actions.toArray(new DataListAction[actions.size()]);
object.setActions(temp2);
//set row actions
Collection<DataListAction> rowActions = parseRowActionsFromJsonObject(obj);
DataListAction[] temp3 = (DataListAction[]) rowActions.toArray(new DataListAction[rowActions.size()]);
object.setRowActions(temp3);
//set filters
Collection<DataListFilter> filters = parseFiltersFromJsonObject(obj);
DataListFilter[] temp4 = (DataListFilter[]) filters.toArray(new DataListFilter[filters.size()]);
object.setFilters(temp4);
}
return object;
}