private JSONArray serializeFilters(RegistryConfiguration conf) throws JSONException { List<RegistryConfiguration.Filter> filters = conf.getFilters(); JSONArray filtersJSON = new JSONArray(); Iterator<RegistryConfiguration.Filter> it = filters.iterator(); while (it.hasNext()) { RegistryConfiguration.Filter filter = it.next(); JSONObject filterJSON = new JSONObject(); String title = filter.getTitle(); String field = filter.getField(); String presentationType = filter.getPresentationType(); filterJSON.put(TITLE, title); filterJSON.put(FIELD, field); filterJSON.put(PRESENTATION, presentationType); filtersJSON.put(filterJSON); } return filtersJSON; }