/*package*/ static List<RetweetDetails> createRetweetDetails(Response res) throws KxException { try { JSONArray list = res.asJSONArray(); int size = list.length(); List<RetweetDetails> retweets = new ArrayList<RetweetDetails>(size); for (int i = 0; i < size; i++) { retweets.add(new RetweetDetails(list.getJSONObject(i))); } return retweets; } catch (JSONException jsone) { throw new KxException(jsone); } catch (KxException te) { throw te; } }
/*package*/ static List<RetweetDetails> createRetweetDetails(Response res, KxSDK kxSDK) throws KxException { Document doc = res.asDocument(); if (isRootNodeNilClasses(doc)) { return new ArrayList<RetweetDetails>(0); } else { try { ensureRootNodeNameIs("retweets", doc); NodeList list = doc.getDocumentElement().getElementsByTagName("retweet_details"); int size = list.getLength(); List<RetweetDetails> statuses = new ArrayList<RetweetDetails>(size); for (int i = 0; i < size; i++) { Element status = (Element) list.item(i); statuses.add(new RetweetDetails(res, status, kxSDK)); } return statuses; } catch (KxException te) { ensureRootNodeNameIs("nil-classes", doc); return new ArrayList<RetweetDetails>(0); } } }
/*package*/ RetweetDetails(Response res, KxSDK kxSDK) throws KxException { super(res); Element elem = res.asDocument().getDocumentElement(); init(res, elem, kxSDK); }