+ * Primary access point to parsed JSON data, including the call to retrieve
+ * and parsing.
+ *
+ * @param url
+ * request url; if null, getUrl(ids) will be used
+ * @param ids
+ * optional; may be null
+ * @param msDelay
+ * -1 for default delay
+ * @param mode
+ * map, array, or array iterator
+ * @param mapKey
+ * an optional key for an outer map
+ * @return a Map, List, Iterator, or null
+ * @throws IOException
+ * @throws ParseException
+ *
+ * @author Bob Hanson 2019
+ */
+ @SuppressWarnings("unchecked")
+ protected Object getJSON(URL url, List<String> ids, int msDelay, int mode,
+ String mapKey) throws IOException, ParseException
+ {
+ if (url == null)
+ {
+ url = getUrl(ids);
+ }
+
+ Object json = (url == null ? null : getJSON(url, ids, msDelay));
+
+ if (json != null && mapKey != null)
+ {
+ json = ((Map<String, Object>) json).get(mapKey);
+ }
+ if (json == null)
+ {
+ return null;
+ }
+ switch (mode)
+ {
+ case MODE_ARRAY:
+ case MODE_MAP:
+ break;
+ case MODE_ITERATOR:
+ json = ((List<Object>) json).iterator();
+ break;
+ }
+ return json;
+ }
+
+ /**