public static List<JSONObject> getlist(String data){ ObjectMapper mapper = new ObjectMapper(); JavaType javaType = getCollectionType(ArrayList.class, JSONObject.class); List<JSONObject> list = null; try { list = mapper.readValue(data,javaType); } catch (IOException e) { e.printStackTrace(); } return list; } public static JavaType getCollectionType(Class<?> collectionClass, Class<?>... elementClasses) { return new ObjectMapper().getTypeFactory().constructParametricType(collectionClass, elementClasses); }