本文整理汇总了Java中twitter4j.conf.Configuration.isJSONStoreEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java Configuration.isJSONStoreEnabled方法的具体用法?Java Configuration.isJSONStoreEnabled怎么用?Java Configuration.isJSONStoreEnabled使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twitter4j.conf.Configuration
的用法示例。
在下文中一共展示了Configuration.isJSONStoreEnabled方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createRelationshipList
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
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);
}
}
示例2: createUserList
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
static ResponseList<User> createUserList(JSONArray list, HttpResponse res, Configuration conf) throws TwitterException {
try {
if (conf.isJSONStoreEnabled()) {
DataObjectFactoryUtil.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()) {
DataObjectFactoryUtil.registerJSONObject(user, json);
}
}
if (conf.isJSONStoreEnabled()) {
DataObjectFactoryUtil.registerJSONObject(users, list);
}
return users;
} catch (JSONException jsone) {
throw new TwitterException(jsone);
} catch (TwitterException te) {
throw te;
}
}
示例3: createLanguageList
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
static ResponseList<HelpResources.Language> createLanguageList(JSONArray list, HttpResponse res
, Configuration conf) throws TwitterException {
if (conf.isJSONStoreEnabled()) {
TwitterObjectFactory.clearThreadLocalMap();
}
try {
int size = list.length();
ResponseList<HelpResources.Language> languages =
new ResponseListImpl<HelpResources.Language>(size, res);
for (int i = 0; i < size; i++) {
JSONObject json = list.getJSONObject(i);
HelpResources.Language language = new LanguageJSONImpl(json);
languages.add(language);
if (conf.isJSONStoreEnabled()) {
TwitterObjectFactory.registerJSONObject(language, json);
}
}
if (conf.isJSONStoreEnabled()) {
TwitterObjectFactory.registerJSONObject(languages, list);
}
return languages;
} catch (JSONException jsone) {
throw new TwitterException(jsone);
}
}
示例4: parseStatuses
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
public static ResponseList<Status> parseStatuses(Configuration conf, JSONArray list) throws JSONException, TwitterException {
if (conf.isJSONStoreEnabled()) {
DataObjectFactoryUtil.clearThreadLocalMap();
}
int size = list.length();
ResponseList<Status> statuses = new ResponseListImpl<Status>(size, null);
for (int i = 0; i < size; i++) {
JSONObject json = list.getJSONObject(i);
Status status = new StatusJSONImpl(json);
if (conf.isJSONStoreEnabled()) {
DataObjectFactoryUtil.registerJSONObject(status, json);
}
statuses.add(status);
}
if (conf.isJSONStoreEnabled()) {
DataObjectFactoryUtil.registerJSONObject(statuses, list);
}
return statuses;
}
示例5: createStatusList
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
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);
}
}
示例6: createFriendshipList
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
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);
}
}
示例7: TrendsJSONImpl
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
TrendsJSONImpl(HttpResponse res, Configuration conf) throws TwitterException {
super(res);
init(res.asString(), conf.isJSONStoreEnabled());
if (conf.isJSONStoreEnabled()) {
TwitterObjectFactory.clearThreadLocalMap();
TwitterObjectFactory.registerJSONObject(this, res.asString());
}
}
示例8: RelationshipJSONImpl
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
RelationshipJSONImpl(HttpResponse res, Configuration conf) throws TwitterException {
this(res, res.asJSONObject());
if (conf.isJSONStoreEnabled()) {
TwitterObjectFactory.clearThreadLocalMap();
TwitterObjectFactory.registerJSONObject(this, res.asJSONObject());
}
}
示例9: DirectMessageJSONImpl
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
DirectMessageJSONImpl(HttpResponse res, Configuration conf) throws TwitterException {
super(res);
JSONObject json = res.asJSONObject();
init(json);
if (conf.isJSONStoreEnabled()) {
TwitterObjectFactory.clearThreadLocalMap();
TwitterObjectFactory.registerJSONObject(this, json);
}
}
示例10: AccountSettingsJSONImpl
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
AccountSettingsJSONImpl(HttpResponse res, Configuration conf) throws TwitterException {
this(res, res.asJSONObject());
if (conf.isJSONStoreEnabled()) {
DataObjectFactoryUtil.clearThreadLocalMap();
DataObjectFactoryUtil.registerJSONObject(this, res.asJSONObject());
}
}
示例11: SavedSearchJSONImpl
import twitter4j.conf.Configuration; //导入方法依赖的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);
}
}
示例12: StatusJSONImpl
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
StatusJSONImpl(HttpResponse res, Configuration conf) throws TwitterException {
super(res);
init(getJSONObject());
if (conf.isJSONStoreEnabled()) {
DataObjectFactoryUtil.clearThreadLocalMap();
DataObjectFactoryUtil.registerJSONObject(this, getJSONObject());
}
}
示例13: UserListJSONImpl
import twitter4j.conf.Configuration; //导入方法依赖的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);
}
}
示例14: TwitterAPIConfigurationJSONImpl
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
TwitterAPIConfigurationJSONImpl(HttpResponse res, Configuration conf)
throws TwitterException {
super(res);
try {
JSONObject json = res.asJSONObject();
photoSizeLimit = getInt("photo_size_limit", json);
shortURLLength = getInt("short_url_length", json);
shortURLLengthHttps = getInt("short_url_length_https", json);
charactersReservedPerMedia = getInt("characters_reserved_per_media", json);
JSONObject sizes = json.getJSONObject("photo_sizes");
photoSizes = new HashMap<Integer, MediaEntity.Size>(4);
photoSizes.put(MediaEntity.Size.LARGE, new MediaEntityJSONImpl.Size(sizes.getJSONObject("large")));
JSONObject medium;
// http://code.google.com/p/twitter-api/issues/detail?id=2230
if (sizes.isNull("med")) {
medium = sizes.getJSONObject("medium");
} else {
medium = sizes.getJSONObject("med");
}
photoSizes.put(MediaEntity.Size.MEDIUM, new MediaEntityJSONImpl.Size(medium));
photoSizes.put(MediaEntity.Size.SMALL, new MediaEntityJSONImpl.Size(sizes.getJSONObject("small")));
photoSizes.put(MediaEntity.Size.THUMB, new MediaEntityJSONImpl.Size(sizes.getJSONObject("thumb")));
if (conf.isJSONStoreEnabled()) {
DataObjectFactoryUtil.clearThreadLocalMap();
DataObjectFactoryUtil.registerJSONObject(this, res.asJSONObject());
}
JSONArray nonUsernamePathsJSONArray = json.getJSONArray("non_username_paths");
nonUsernamePaths = new String[nonUsernamePathsJSONArray.length()];
for (int i = 0; i < nonUsernamePathsJSONArray.length(); i++) {
nonUsernamePaths[i] = nonUsernamePathsJSONArray.getString(i);
}
maxMediaPerUpload = getInt("max_media_per_upload", json);
} catch (JSONException jsone) {
throw new TwitterException(jsone);
}
}
示例15: UserListJSONImpl
import twitter4j.conf.Configuration; //导入方法依赖的package包/类
UserListJSONImpl(HttpResponse res, Configuration conf) throws TwitterException {
super(res);
init(getJSONObject());
if (conf.isJSONStoreEnabled()) {
DataObjectFactoryUtil.clearThreadLocalMap();
}
if (conf.isJSONStoreEnabled()) {
DataObjectFactoryUtil.registerJSONObject(this, getJSONObject());
}
}