コード例 #1
0
 /*package*/
 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);
   } catch (TwitterException te) {
     throw te;
   }
 }
コード例 #2
0
 /*package*/ StatusJSONImpl(HttpResponse res, Configuration conf) throws TwitterException {
   super(res);
   JSONObject json = res.asJSONObject();
   init(json);
   if (conf.isJSONStoreEnabled()) {
     DataObjectFactoryUtil.clearThreadLocalMap();
     DataObjectFactoryUtil.registerJSONObject(this, json);
   }
 }