Search in sources :

Example 1 with WikiJson

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

the class WikiDao method mapperJson.

public WikiResponseEntity mapperJson(boolean useCache) {
    // TODO Auto-generated method stub
    WikiJson wikiJson;
    try {
        String result = RequestCacheUtil.getRequestContent(mActivity, Urls.WIKI_LIST + Utility.getScreenParams(mActivity), Constants.WebSourceType.Json, Constants.DBContentType.Content_list, useCache);
        wikiJson = mObjectMapper.readValue(result, new TypeReference<WikiJson>() {
        });
        if (wikiJson == null) {
            return null;
        }
        this.mWikiResponseEntity = wikiJson.getResponse();
        return mWikiResponseEntity;
    } 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 : JsonMappingException(org.codehaus.jackson.map.JsonMappingException) TypeReference(org.codehaus.jackson.type.TypeReference) IOException(java.io.IOException) JsonParseException(org.codehaus.jackson.JsonParseException) WikiJson(cn.eoe.app.entity.WikiJson) JsonMappingException(org.codehaus.jackson.map.JsonMappingException) JsonParseException(org.codehaus.jackson.JsonParseException) IOException(java.io.IOException)

Aggregations

WikiJson (cn.eoe.app.entity.WikiJson)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