Android 利用fastjson进行json解析
fastjson
FASTJSON 2.0.x has been released, faster and more secure, recommend you upgrade.
项目地址:https://gitcode.com/gh_mirrors/fastj/fastjson
免费下载资源
·
package com.example.FastJson.util;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.TypeReference;
import java.util.List;
import java.util.Map;
/**
* Created by chang on 14-10-3.
*/
public class jsonUtil {
public static <T> T getObject(String jsonString, Class<T> cls) {
return JSON.parseObject(jsonString,cls);
}
public static <T> List<T> getObjects(String jsonString, Class<T> cls) {
return JSON.parseArray(jsonString,cls);
}
public static List<Map<String,String>> getKeyMapsList(String jsonString) {
List<Map<String,String>> list;
list = JSON.parseObject(jsonString, new TypeReference<List<Map<String, String>>>(){});
return list;
}
}
GitHub 加速计划 / fastj / fastjson
25.69 K
6.51 K
下载
FASTJSON 2.0.x has been released, faster and more secure, recommend you upgrade.
最近提交(Master分支:3 个月前 )
c942c834 - 1 年前
5bc4709b - 1 年前
更多推荐
已为社区贡献2条内容
所有评论(0)