當前位置: 首頁>>代碼示例>>Java>>正文


Java Configuration類代碼示例

本文整理匯總了Java中twitter4j.conf.Configuration的典型用法代碼示例。如果您正苦於以下問題:Java Configuration類的具體用法?Java Configuration怎麽用?Java Configuration使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Configuration類屬於twitter4j.conf包,在下文中一共展示了Configuration類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: TwitterAdsImpl

import twitter4j.conf.Configuration; //導入依賴的package包/類
TwitterAdsImpl(Configuration conf, Authorization auth) {
    this.twitterAdsClient = new TwitterAdsClient(conf, auth);
    this.targetingApi = new TwitterAdsTargetingApiImpl(twitterAdsClient);
    this.accountApi = new TwitterAdsAccountApiImpl(twitterAdsClient);
    this.lineItemApi = new TwitterAdsLineItemApiImpl(twitterAdsClient);
    this.cardsApi = new TwitterAdsCardsApiImpl(twitterAdsClient);
    this.fundingInstrumentApi = new TwitterAdsFundingInstrumentApiImpl(twitterAdsClient);
    this.promotedApi = new TwitterAdsVideoApiImpl(twitterAdsClient);
    this.tailoredAudienceApi = new TwitterAdsAudienceApiImpl(twitterAdsClient);
    this.statApi = new TwitterAdsStatApiImpl(twitterAdsClient);
    this.webEventApi = new TwitterAdsWebEventApiImpl(twitterAdsClient);
    this.campaignApi = new TwitterAdsCampaignApiImpl(twitterAdsClient);
    this.promotedTweetApi = new TwitterAdsPromotedTweetApiImpl(twitterAdsClient);
    this.biddingApi = new TwitterAdsBiddingApiImpl(twitterAdsClient);
    this.adsPreviewApi = new TwitterAdsPreviewApiImpl(twitterAdsClient);
    this.callToActionApi = new TwitterCallToActionApiImpl(twitterAdsClient);
    this.scheduledTweetApi = new TwitterScheduledTweetsApiImpl(twitterAdsClient);
}
 
開發者ID:sprinklr-inc,項目名稱:twitter4j-ads,代碼行數:19,代碼來源:TwitterAdsImpl.java

示例2: getConfiguration

import twitter4j.conf.Configuration; //導入依賴的package包/類
/**
 * Builds a Twitter4J Configuration using the OAuth params.
 *
 * @return Configuration
 */
public Configuration getConfiguration() {
    checkComplete();
    ConfigurationBuilder confBuilder = new ConfigurationBuilder();
    confBuilder.setOAuthConsumerKey(consumerKey);
    confBuilder.setOAuthConsumerSecret(consumerSecret);
    confBuilder.setOAuthAccessToken(accessToken);
    confBuilder.setOAuthAccessTokenSecret(accessTokenSecret);
    if (getHttpProxyHost() != null) {
        confBuilder.setHttpProxyHost(getHttpProxyHost());
    }
    if (getHttpProxyUser() != null) {
        confBuilder.setHttpProxyHost(getHttpProxyUser());
    }
    if (getHttpProxyPassword() != null) {
        confBuilder.setHttpProxyHost(getHttpProxyPassword());
    }
    if (httpProxyPort != null) {
        confBuilder.setHttpProxyPort(httpProxyPort);
    }
    
    return confBuilder.build();
}
 
開發者ID:HydAu,項目名稱:Camel,代碼行數:28,代碼來源:TwitterConfiguration.java

示例3: 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;
    }
}
 
開發者ID:sprinklr-inc,項目名稱:twitter4j-ads,代碼行數:26,代碼來源:UserJSONImpl.java

示例4: createDirectMessageList

import twitter4j.conf.Configuration; //導入依賴的package包/類
static ResponseList<DirectMessage> createDirectMessageList(HttpResponse res, Configuration conf) throws TwitterException {
    try {
        if (conf.isJSONStoreEnabled()) {
            DataObjectFactoryUtil.clearThreadLocalMap();
        }
        JSONArray list = res.asJSONArray();
        int size = list.length();
        ResponseList<DirectMessage> directMessages = new ResponseListImpl<DirectMessage>(size, res);
        for (int i = 0; i < size; i++) {
            JSONObject json = list.getJSONObject(i);
            DirectMessage directMessage = new DirectMessageJSONImpl(json);
            directMessages.add(directMessage);
            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.registerJSONObject(directMessage, json);
            }
        }
        if (conf.isJSONStoreEnabled()) {
            DataObjectFactoryUtil.registerJSONObject(directMessages, list);
        }
        return directMessages;
    } catch (JSONException jsone) {
        throw new TwitterException(jsone);
    } catch (TwitterException te) {
        throw te;
    }
}
 
開發者ID:sprinklr-inc,項目名稱:twitter4j-ads,代碼行數:27,代碼來源:DirectMessageJSONImpl.java

示例5: createStatusList

import twitter4j.conf.Configuration; //導入依賴的package包/類
public static ResponseList<Status> createStatusList(HttpResponse res, Configuration conf) throws TwitterException {
    try {
        if (conf.isJSONStoreEnabled()) {
            DataObjectFactoryUtil.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()) {
                DataObjectFactoryUtil.registerJSONObject(status, json);
            }
            statuses.add(status);
        }
        if (conf.isJSONStoreEnabled()) {
            DataObjectFactoryUtil.registerJSONObject(statuses, list);
        }
        return statuses;
    } catch (JSONException jsone) {
        throw new TwitterException(jsone);
    }
}
 
開發者ID:sprinklr-inc,項目名稱:twitter4j-ads,代碼行數:25,代碼來源:StatusJSONImpl.java

示例6: 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;
}
 
開發者ID:sprinklr-inc,項目名稱:twitter4j-ads,代碼行數:20,代碼來源:StatusJSONImpl.java

示例7: createUserListList

import twitter4j.conf.Configuration; //導入依賴的package包/類
static ResponseList<UserList> createUserListList(HttpResponse res, Configuration conf) throws TwitterException {
    try {
        if (conf.isJSONStoreEnabled()) {
            DataObjectFactoryUtil.clearThreadLocalMap();
        }
        JSONArray list = res.asJSONArray();
        int size = list.length();
        ResponseList<UserList> users = new ResponseListImpl<UserList>(size, res);
        for (int i = 0; i < size; i++) {
            JSONObject userListJson = list.getJSONObject(i);
            UserList userList = new UserListJSONImpl(userListJson);
            users.add(userList);
            if (conf.isJSONStoreEnabled()) {
                DataObjectFactoryUtil.registerJSONObject(userList, userListJson);
            }
        }
        if (conf.isJSONStoreEnabled()) {
            DataObjectFactoryUtil.registerJSONObject(users, list);
        }
        return users;
    } catch (JSONException jsone) {
        throw new TwitterException(jsone);
    } catch (TwitterException te) {
        throw te;
    }
}
 
開發者ID:sprinklr-inc,項目名稱:twitter4j-ads,代碼行數:27,代碼來源:UserListJSONImpl.java

示例8: DispatcherImpl

import twitter4j.conf.Configuration; //導入依賴的package包/類
public DispatcherImpl(final Configuration conf) {
    executorService = Executors.newFixedThreadPool(conf.getAsyncNumThreads(),
            new ThreadFactory() {
                int count = 0;

                @Override
                public Thread newThread(Runnable r) {
                    Thread thread = new Thread(r);
                    thread.setName(String.format("Twitter4J Async Dispatcher[%d]", count++));
                    thread.setDaemon(conf.isDaemonEnabled());
                    return thread;
                }
            }
    );
    Runtime.getRuntime().addShutdownHook(new Thread() {
        @Override
        public void run() {
            executorService.shutdown();
        }
    });
}
 
開發者ID:DiscourseDB,項目名稱:discoursedb-core,代碼行數:22,代碼來源:DispatcherImpl.java

示例9: createSavedSearchList

import twitter4j.conf.Configuration; //導入依賴的package包/類
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);
    }
}
 
開發者ID:DiscourseDB,項目名稱:discoursedb-core,代碼行數:25,代碼來源:SavedSearchJSONImpl.java

示例10: 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);
    }
}
 
開發者ID:DiscourseDB,項目名稱:discoursedb-core,代碼行數:25,代碼來源:FriendshipJSONImpl.java

示例11: createPagableUserList

import twitter4j.conf.Configuration; //導入依賴的package包/類
static PagableResponseList<User> createPagableUserList(HttpResponse res, Configuration conf) throws TwitterException {
    try {
        if (conf.isJSONStoreEnabled()) {
            TwitterObjectFactory.clearThreadLocalMap();
        }
        JSONObject json = res.asJSONObject();
        JSONArray list = json.getJSONArray("users");
        int size = list.length();
        PagableResponseList<User> users =
                new PagableResponseListImpl<User>(size, json, res);
        for (int i = 0; i < size; i++) {
            JSONObject userJson = list.getJSONObject(i);
            User user = new UserJSONImpl(userJson);
            if (conf.isJSONStoreEnabled()) {
                TwitterObjectFactory.registerJSONObject(user, userJson);
            }
            users.add(user);
        }
        if (conf.isJSONStoreEnabled()) {
            TwitterObjectFactory.registerJSONObject(users, json);
        }
        return users;
    } catch (JSONException jsone) {
        throw new TwitterException(jsone);
    }
}
 
開發者ID:DiscourseDB,項目名稱:discoursedb-core,代碼行數:27,代碼來源:UserJSONImpl.java

示例12: createUserList

import twitter4j.conf.Configuration; //導入依賴的package包/類
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);
    }
}
 
開發者ID:DiscourseDB,項目名稱:discoursedb-core,代碼行數:25,代碼來源:UserJSONImpl.java

示例13: createDirectMessageList

import twitter4j.conf.Configuration; //導入依賴的package包/類
static ResponseList<DirectMessage> createDirectMessageList(HttpResponse res, Configuration conf) throws TwitterException {
    try {
        if (conf.isJSONStoreEnabled()) {
            TwitterObjectFactory.clearThreadLocalMap();
        }
        JSONArray list = res.asJSONArray();
        int size = list.length();
        ResponseList<DirectMessage> directMessages = new ResponseListImpl<DirectMessage>(size, res);
        for (int i = 0; i < size; i++) {
            JSONObject json = list.getJSONObject(i);
            DirectMessage directMessage = new DirectMessageJSONImpl(json);
            directMessages.add(directMessage);
            if (conf.isJSONStoreEnabled()) {
                TwitterObjectFactory.registerJSONObject(directMessage, json);
            }
        }
        if (conf.isJSONStoreEnabled()) {
            TwitterObjectFactory.registerJSONObject(directMessages, list);
        }
        return directMessages;
    } catch (JSONException jsone) {
        throw new TwitterException(jsone);
    }
}
 
開發者ID:DiscourseDB,項目名稱:discoursedb-core,代碼行數:25,代碼來源:DirectMessageJSONImpl.java

示例14: QueryResultJSONImpl

import twitter4j.conf.Configuration; //導入依賴的package包/類
QueryResultJSONImpl(HttpResponse res, Configuration conf) throws TwitterException {
    super(res);
    JSONObject json = res.asJSONObject();
    try {
        JSONObject searchMetaData = json.getJSONObject("search_metadata");
        completedIn = ParseUtil.getDouble("completed_in", searchMetaData);
        count = ParseUtil.getInt("count", searchMetaData);
        maxId = ParseUtil.getLong("max_id", searchMetaData);
        nextResults = searchMetaData.has("next_results") ? searchMetaData.getString("next_results") : null;
        query = ParseUtil.getURLDecodedString("query", searchMetaData);
        refreshUrl = ParseUtil.getUnescapedString("refresh_url", searchMetaData);
        sinceId = ParseUtil.getLong("since_id", searchMetaData);

        JSONArray array = json.getJSONArray("statuses");
        tweets = new ArrayList<Status>(array.length());
        if (conf.isJSONStoreEnabled()) {
            TwitterObjectFactory.clearThreadLocalMap();
        }
        for (int i = 0; i < array.length(); i++) {
            JSONObject tweet = array.getJSONObject(i);
            tweets.add(new StatusJSONImpl(tweet, conf));
        }
    } catch (JSONException jsone) {
        throw new TwitterException(jsone.getMessage() + ":" + json.toString(), jsone);
    }
}
 
開發者ID:DiscourseDB,項目名稱:discoursedb-core,代碼行數:27,代碼來源:QueryResultJSONImpl.java

示例15: createPlaceList

import twitter4j.conf.Configuration; //導入依賴的package包/類
static ResponseList<Place> createPlaceList(JSONArray list, HttpResponse res
        , Configuration conf) throws TwitterException {
    if (conf.isJSONStoreEnabled()) {
        TwitterObjectFactory.clearThreadLocalMap();
    }
    try {
        int size = list.length();
        ResponseList<Place> places =
                new ResponseListImpl<Place>(size, res);
        for (int i = 0; i < size; i++) {
            JSONObject json = list.getJSONObject(i);
            Place place = new PlaceJSONImpl(json);
            places.add(place);
            if (conf.isJSONStoreEnabled()) {
                TwitterObjectFactory.registerJSONObject(place, json);
            }
        }
        if (conf.isJSONStoreEnabled()) {
            TwitterObjectFactory.registerJSONObject(places, list);
        }
        return places;
    } catch (JSONException jsone) {
        throw new TwitterException(jsone);
    }
}
 
開發者ID:DiscourseDB,項目名稱:discoursedb-core,代碼行數:26,代碼來源:PlaceJSONImpl.java


注:本文中的twitter4j.conf.Configuration類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。