Search in sources :

Example 1 with TopicResultListBean

use of org.qii.weiciyuan.bean.TopicResultListBean in project weiciyuan by qii.

the class SearchTopicDao method getGSONMsgList.

public TopicResultListBean getGSONMsgList() throws WeiboException {
    String json = getMsgListJson();
    Gson gson = new Gson();
    TopicResultListBean value = null;
    try {
        value = gson.fromJson(json, TopicResultListBean.class);
    } catch (JsonSyntaxException e) {
        AppLogger.e(e.getMessage());
        return null;
    }
    if (value != null && value.getStatuses() != null && value.getStatuses().size() > 0) {
        List<MessageBean> msgList = value.getStatuses();
        Iterator<MessageBean> iterator = msgList.iterator();
        while (iterator.hasNext()) {
            MessageBean msg = iterator.next();
            if (msg.getUser() == null) {
                iterator.remove();
            } else {
                msg.getListViewSpannableString();
                TimeUtility.dealMills(msg);
            }
        }
    }
    return value;
}
Also used : MessageBean(org.qii.weiciyuan.bean.MessageBean) JsonSyntaxException(com.google.gson.JsonSyntaxException) TopicResultListBean(org.qii.weiciyuan.bean.TopicResultListBean) Gson(com.google.gson.Gson)

Example 2 with TopicResultListBean

use of org.qii.weiciyuan.bean.TopicResultListBean in project weiciyuan by qii.

the class SearchTopicByNameLoader method loadData.

public TopicResultListBean loadData() throws WeiboException {
    SearchTopicDao dao = new SearchTopicDao(token, searchWord);
    dao.setPage(page);
    TopicResultListBean result = null;
    lock.lock();
    try {
        result = dao.getGSONMsgList();
    } finally {
        lock.unlock();
    }
    return result;
}
Also used : SearchTopicDao(org.qii.weiciyuan.dao.topic.SearchTopicDao) TopicResultListBean(org.qii.weiciyuan.bean.TopicResultListBean)

Aggregations

TopicResultListBean (org.qii.weiciyuan.bean.TopicResultListBean)2 Gson (com.google.gson.Gson)1 JsonSyntaxException (com.google.gson.JsonSyntaxException)1 MessageBean (org.qii.weiciyuan.bean.MessageBean)1 SearchTopicDao (org.qii.weiciyuan.dao.topic.SearchTopicDao)1