public static List<Resource> newObjectFromJSONArray(JSONArray dataArray,List<Resource> included) throws Exception {
  ArrayList<Resource> objects=new ArrayList<>();
  for (int i=0; i < dataArray.length(); i++) {
    JSONObject jsonObject=null;
    try {
      jsonObject=dataArray.getJSONObject(i);
    }
 catch (    JSONException e) {
      Logger.debug("Was not able to get dataArray[" + i + "] as JSONObject.");
    }
    try {
      objects.add(newObjectFromJSONObject(jsonObject,included));
    }
 catch (    Exception e) {
      throw e;
    }
  }
  return objects;
}

public static List < Resource > newObjectFromJSONArray ( JSONArray dataArray , List < Resource > included ) throws Exception { ArrayList < Resource > objects = new ArrayList < > ( ) ; for ( int i = 0 ; i < dataArray . length ( ) ; i ++ ) { JSONObject jsonObject = null ; try { jsonObject = dataArray . getJSONObject ( i ) ; } catch ( JSONException e ) { Logger . debug ( "Was not able to get dataArray[" + i + "] as JSONObject." ) ; } try { objects . add ( newObjectFromJSONObject ( jsonObject , included ) ) ; } catch ( Exception e ) { throw e ; } } return objects ; }
loops through data objects and deserializes them .
