private ArrayList<RemoteObject> deserializeArrayAsJson(String queryScope, String input) { ArrayList<RemoteObject> objects = new ArrayList<RemoteObject>(); JsonParser parser = new JsonParser(input); JsonArray parent = ((JsonElement) parser.parse( HttpAdapter.createResponseWrangling(queryScope, this).getCollectionSelector(), JsonElement.class)) .getAsJsonArray(); for (int i = 0; i < parent.size(); i++) { objects.add(deserialize(queryScope, new JsonParser(parent.get(i)))); } return objects; }
private ArrayList<RemoteObject> deserializeArrayAsXml(String queryScope, String input) { ArrayList<RemoteObject> objects = new ArrayList<RemoteObject>(); XmlParser parser = new XmlParser(input); XmlElement parent = ((XmlElement) parser.parse( HttpAdapter.createResponseWrangling(queryScope, this).getCollectionSelector(), XmlElement.class)) .getParent(); for (int i = 0; i < parent.getChildCount(); i++) { objects.add(deserialize(queryScope, new XmlParser(parent.get(i)))); } return objects; }