@Test public void testIndicatorSource() throws JSONException { Map<String, String> sources = UnsdIndicatorParser.parseSource(dataResponseUnlimited); assertNotNull("Indicator doesn't have source.", sources.get("en")); }
public Map<String, IndicatorValue> get(StatisticalIndicatorDataModel selectors, String indicator, String[] areaCodes) { UnsdRequest request = new UnsdRequest(config); request.setIndicator(indicator); request.setAreaCodes(areaCodes); Map<String, IndicatorValue> result = new HashMap<>(); try { while (true) { JSONObject response = JSONHelper.createJSONObject(request.getIndicatorData(selectors)); result.putAll(parseIndicatorData(response)); if (isLastPage(response)) { break; } request.nextPage(); } } catch (JSONException ex) { throw new APIException("Error during parsing UNSD data response.", ex); } return result; }
UnsdDataParser { public Map<String, IndicatorValue> get(StatisticalIndicatorDataModel selectors, String indicator, String[] areaCodes) { UnsdRequest request = new UnsdRequest(config); request.setIndicator(indicator); request.setAreaCodes(areaCodes); Map<String, IndicatorValue> result = new HashMap<>(); try { while (true) { JSONObject response = JSONHelper.createJSONObject(request.getIndicatorData(selectors)); result.putAll(parseIndicatorData(response)); if (isLastPage(response)) { break; } request.nextPage(); } } catch (JSONException ex) { throw new APIException("Error during parsing UNSD data response.", ex); } return result; } }
UnsdDataParser { public Map<String, IndicatorValue> get(StatisticalIndicatorDataModel selectors, String indicator, String[] areaCodes) { UnsdRequest request = new UnsdRequest(config); request.setIndicator(indicator); request.setAreaCodes(areaCodes); Map<String, IndicatorValue> result = new HashMap<>(); try { while (true) { JSONObject response = JSONHelper.createJSONObject(request.getIndicatorData(selectors)); result.putAll(parseIndicatorData(response)); if (isLastPage(response)) { break; } request.nextPage(); } } catch (JSONException ex) { throw new APIException("Error during parsing UNSD data response.", ex); } return result; } UnsdDataParser(UnsdConfig config); }
UnsdDataParser { public Map<String, IndicatorValue> get(StatisticalIndicatorDataModel selectors, String indicator, String[] areaCodes) { UnsdRequest request = new UnsdRequest(config); request.setIndicator(indicator); request.setAreaCodes(areaCodes); Map<String, IndicatorValue> result = new HashMap<>(); try { while (true) { JSONObject response = JSONHelper.createJSONObject(request.getIndicatorData(selectors)); result.putAll(parseIndicatorData(response)); if (isLastPage(response)) { break; } request.nextPage(); } } catch (JSONException ex) { throw new APIException("Error during parsing UNSD data response.", ex); } return result; } UnsdDataParser(UnsdConfig config); Map<String, IndicatorValue> get(StatisticalIndicatorDataModel selectors, String indicator, String[] areaCodes); StatisticalIndicatorDataDimension getTimeperiodDimensionFromIndicatorData(String timePeriodDimensionId,
            String indicator, String[] areaCodes); static void parseTimePeriod(Map<Integer, Set<Integer>> geoAreaCodesForYears, JSONObject response); static List<IdNamePair> getSortedListOfYearsThatBelongToSeveralGeoAreas(
            Map<Integer,  Set<Integer>> countOfAreaCodesForYear); }
UnsdDataParser { public Map<String, IndicatorValue> get(StatisticalIndicatorDataModel selectors, String indicator, String[] areaCodes) { UnsdRequest request = new UnsdRequest(config); request.setIndicator(indicator); request.setAreaCodes(areaCodes); Map<String, IndicatorValue> result = new HashMap<>(); try { while (true) { JSONObject response = JSONHelper.createJSONObject(request.getIndicatorData(selectors)); result.putAll(parseIndicatorData(response)); if (isLastPage(response)) { break; } request.nextPage(); } } catch (JSONException ex) { throw new APIException("Error during parsing UNSD data response.", ex); } return result; } UnsdDataParser(UnsdConfig config); Map<String, IndicatorValue> get(StatisticalIndicatorDataModel selectors, String indicator, String[] areaCodes); StatisticalIndicatorDataDimension getTimeperiodDimensionFromIndicatorData(String timePeriodDimensionId,
            String indicator, String[] areaCodes); static void parseTimePeriod(Map<Integer, Set<Integer>> geoAreaCodesForYears, JSONObject response); static List<IdNamePair> getSortedListOfYearsThatBelongToSeveralGeoAreas(
            Map<Integer,  Set<Integer>> countOfAreaCodesForYear);  }