/*package*/ RelationshipJSONImpl(HttpResponse res, Configuration conf) throws TwitterException { this(res, res.asJSONObject()); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); TwitterObjectFactory.registerJSONObject(this, res.asJSONObject()); } }
/*package*/ IDsJSONImpl(HttpResponse res, Configuration conf) throws TwitterException { super(res); String json = res.asString(); init(json); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); TwitterObjectFactory.registerJSONObject(this, json); } }
/*package*/ AccountSettingsJSONImpl(HttpResponse res, Configuration conf) throws TwitterException { this(res, res.asJSONObject()); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); TwitterObjectFactory.registerJSONObject(this, res.asJSONObject()); } }
/*package*/ AccountTotalsJSONImpl(HttpResponse res, Configuration conf) throws TwitterException { this(res, res.asJSONObject()); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); TwitterObjectFactory.registerJSONObject(this, res.asJSONObject()); } }
/*package*/ PlaceJSONImpl(HttpResponse res, Configuration conf) throws TwitterException { super(res); JSONObject json = res.asJSONObject(); init(json); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); TwitterObjectFactory.registerJSONObject(this, json); } }
/*package*/ OEmbedJSONImpl(HttpResponse res, Configuration conf) throws TwitterException { super(res); JSONObject json = res.asJSONObject(); init(json); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); TwitterObjectFactory.registerJSONObject(this, json); } }
static ResponseList<Location> createLocationList(HttpResponse res, Configuration conf) throws TwitterException { if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); } return createLocationList(res.asJSONArray(), conf.isJSONStoreEnabled()); }
/*package*/StatusJSONImpl(HttpResponse res, Configuration conf) throws TwitterException { super(res); JSONObject json = res.asJSONObject(); init(json); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); TwitterObjectFactory.registerJSONObject(this, json); } }
static Map<String, RateLimitStatus> createRateLimitStatuses(HttpResponse res, Configuration conf) throws TwitterException { JSONObject json = res.asJSONObject(); Map<String, RateLimitStatus> map = createRateLimitStatuses(json); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); TwitterObjectFactory.registerJSONObject(map, json); } return map; }
/*package*/UserJSONImpl(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); } }
/*package*/ SavedSearchJSONImpl(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); } }
/*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); } }
TrendsJSONImpl(HttpResponse res, Configuration conf) throws TwitterException { super(res); init(res.asString(), conf.isJSONStoreEnabled()); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); TwitterObjectFactory.registerJSONObject(this, res.asString()); } }
/*package*/DirectMessageJSONImpl(HttpResponse res, Configuration conf) throws TwitterException { super(res); JSONObject json = res.asJSONObject(); try { JSONObject event = json.getJSONObject("event"); init(event); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); TwitterObjectFactory.registerJSONObject(this, event); } } catch (JSONException jsone) { throw new TwitterException(jsone); } }
static ResponseList<User> createUserList(JSONArray list, HttpResponse res, Configuration conf) throws TwitterException { try { if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); } int size = list.length(); ResponseList<User> users = new ResponseListImpl<User>(size, res); for (int i = 0; i < size; i++) { JSONObject json = list.getJSONObject(i); User user = new UserJSONImpl(json); users.add(user); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(user, json); } } if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(users, list); } return users; } catch (JSONException jsone) { throw new TwitterException(jsone); } }
static ResponseList<Category> createCategoriesList(JSONArray array, HttpResponse res, Configuration conf) throws TwitterException { try { if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); } ResponseList<Category> categories = new ResponseListImpl<Category>(array.length(), res); for (int i = 0; i < array.length(); i++) { JSONObject json = array.getJSONObject(i); Category category = new CategoryJSONImpl(json); categories.add(category); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(category, json); } } if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(categories, array); } return categories; } catch (JSONException jsone) { throw new TwitterException(jsone); } }
static ResponseList<Status> createStatusList(HttpResponse res, Configuration conf) throws TwitterException { try { if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); } JSONArray list = res.asJSONArray(); int size = list.length(); ResponseList<Status> statuses = new ResponseListImpl<Status>(size, res); for (int i = 0; i < size; i++) { JSONObject json = list.getJSONObject(i); Status status = new StatusJSONImpl(json); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(status, json); } statuses.add(status); } if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(statuses, list); } return statuses; } catch (JSONException jsone) { throw new TwitterException(jsone); } }
static ResponseList<Relationship> createRelationshipList(HttpResponse res, Configuration conf) throws TwitterException { try { if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); } JSONArray list = res.asJSONArray(); int size = list.length(); ResponseList<Relationship> relationships = new ResponseListImpl<Relationship>(size, res); for (int i = 0; i < size; i++) { JSONObject json = list.getJSONObject(i); Relationship relationship = new RelationshipJSONImpl(json); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(relationship, json); } relationships.add(relationship); } if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(relationships, list); } return relationships; } catch (JSONException jsone) { throw new TwitterException(jsone); } }
static ResponseList<Friendship> createFriendshipList(HttpResponse res, Configuration conf) throws TwitterException { try { if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); } JSONArray list = res.asJSONArray(); int size = list.length(); ResponseList<Friendship> friendshipList = new ResponseListImpl<Friendship>(size, res); for (int i = 0; i < size; i++) { JSONObject json = list.getJSONObject(i); Friendship friendship = new FriendshipJSONImpl(json); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(friendship, json); } friendshipList.add(friendship); } if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(friendshipList, list); } return friendshipList; } catch (JSONException jsone) { throw new TwitterException(jsone); } }
static ResponseList<SavedSearch> createSavedSearchList(HttpResponse res, Configuration conf) throws TwitterException { if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.clearThreadLocalMap(); } JSONArray json = res.asJSONArray(); ResponseList<SavedSearch> savedSearches; try { savedSearches = new ResponseListImpl<SavedSearch>(json.length(), res); for (int i = 0; i < json.length(); i++) { JSONObject savedSearchesJSON = json.getJSONObject(i); SavedSearch savedSearch = new SavedSearchJSONImpl(savedSearchesJSON); savedSearches.add(savedSearch); if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(savedSearch, savedSearchesJSON); } } if (conf.isJSONStoreEnabled()) { TwitterObjectFactory.registerJSONObject(savedSearches, json); } return savedSearches; } catch (JSONException jsone) { throw new TwitterException(jsone.getMessage() + ":" + res.asString(), jsone); } }