/*package*/ static PagableResponseList<UserList> createPagableUserListList( HttpResponse res, Configuration conf) throws TwitterException { try { if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); } JSONObject json = res.asJSONObject(); JSONArray list = json.getJSONArray("lists"); int size = list.length(); PagableResponseList<UserList> users = new PagableResponseListImpl<UserList>(size, json, res); for (int i = 0; i < size; i++) { JSONObject userListJson = list.getJSONObject(i); UserList userList = new UserListJSONImpl(userListJson); users.add(userList); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(userList, userListJson); } } if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(users, json); } return users; } catch (JSONException jsone) { throw new TwitterException(jsone); } }
/*package*/ UserListJSONImpl(HttpResponse res, Configuration conf) throws TwitterException { super(res); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); } JSONObject json = res.asJSONObject(); init(json); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(this, json); } }
DirectMessageJSONImpl(HttpResponse httpresponse, Configuration configuration) { super(httpresponse); httpresponse = httpresponse.asJSONObject(); init(httpresponse); if (configuration.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); TwitterObjectFactory.registerJSONObject(this, httpresponse); } }
SavedSearchJSONImpl(HttpResponse httpresponse, Configuration configuration) throws TwitterException { super(httpresponse); if (configuration.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); } httpresponse = httpresponse.asJSONObject(); init(httpresponse); if (configuration.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(this, httpresponse); } }