* @param br
* @return
*/
- private SequenceI parseFeaturesJson(BufferedReader br)
+ @SuppressWarnings("unchecked")
- private SequenceI parseFeaturesJson(List<String> queries)
++ private SequenceI parseFeaturesJson(List<String> queries)
{
-
-
SequenceI seq = new Sequence("Dummy", "");
--
- JSONParser jp = new JSONParser();
try
{
-
- JSONArray responses = (JSONArray) jp.parse(br);
- Iterator rvals = responses.iterator();
- while (rvals.hasNext())
+ Iterator<Object> rvals = (Iterator<Object>) getJSON(null, queries, -1, MODE_ITERATOR, null);
+ if (rvals == null)
+ {
+ return null;
++ }
+ while (rvals.hasNext())
+ {
try
{
- JSONObject obj = (JSONObject) rvals.next();
+ Map<String, Object> obj = (Map<String, Object>) rvals.next();
String type = obj.get("feature_type").toString();
int start = Integer.parseInt(obj.get("start").toString());
int end = Integer.parseInt(obj.get("end").toString());
* @param keys
* @return
*/
- protected String getFirstNotNull(JSONObject obj, String... keys)
++ @SuppressWarnings("unchecked")
+ protected String getFirstNotNull(Map<String, Object> obj, String... keys)
{
-- String desc = null;
--
for (String key : keys)
{
Object val = obj.get(key);
if (val != null)
{
- String s = val.toString();
- String s = val instanceof JSONArray
- ? JSONUtils.arrayToList((JSONArray) val)
++ String s = val instanceof List<?>
++ ? JSONUtils.arrayToStringList((List<Object>) val)
+ : val.toString();
if (!s.isEmpty())
{
return s;
}
}
}
-- return desc;
++ return null;
}
/**