Search in sources :

Example 1 with NewsJson

use of cn.eoe.app.entity.NewsJson in project android-app by eoecn.

the class NewsDao method mapperJson.

public NewsResponseEntity mapperJson(boolean useCache) {
    // TODO Auto-generated method stub
    NewsJson newsJson;
    try {
        String result = RequestCacheUtil.getRequestContent(mActivity, Urls.NEWS_LIST + Utility.getScreenParams(mActivity), Constants.WebSourceType.Json, Constants.DBContentType.Content_list, useCache);
        newsJson = mObjectMapper.readValue(result, new TypeReference<NewsJson>() {
        });
        if (newsJson == null) {
            return null;
        }
        this._newsResponse = newsJson.getResponse();
        return _newsResponse;
    } catch (JsonParseException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (JsonMappingException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }
    return null;
}
Also used : NewsJson(cn.eoe.app.entity.NewsJson) JsonMappingException(org.codehaus.jackson.map.JsonMappingException) TypeReference(org.codehaus.jackson.type.TypeReference) IOException(java.io.IOException) JsonParseException(org.codehaus.jackson.JsonParseException) JsonMappingException(org.codehaus.jackson.map.JsonMappingException) JsonParseException(org.codehaus.jackson.JsonParseException) IOException(java.io.IOException)

Aggregations

NewsJson (cn.eoe.app.entity.NewsJson)1 IOException (java.io.IOException)1 JsonParseException (org.codehaus.jackson.JsonParseException)1 JsonMappingException (org.codehaus.jackson.map.JsonMappingException)1 TypeReference (org.codehaus.jackson.type.TypeReference)1