/** * Gets the sub items. * * @param field the field * @return the sub items */ public List<SPListItem> getSubItems(String field) { JSONObject subItemsJson = (JSONObject) getData(field); try { return OfficeEntity.listFromJson(subItemsJson, SPListItem.class); } catch (JSONException e) { throw new IllegalArgumentException("Cant get sub items from field " + field, e); } }
/** * List from json. * * @param json the json * @return the list * @throws JSONException the JSON exception */ public static List<SPListItem> listFromJson(JSONObject json) throws JSONException { return OfficeEntity.listFromJson(json, SPListItem.class); }