android FastJson的使用
阿里巴巴FastJson是一个Json处理工具包,包括“序列化”和“反序列化”两部分,它是目前速度最快json解析类。
public static T getPerson(String jsonString, Class cls) {
T t = null;
try {
t = JSON.parseObject(jsonString, cls);
} catch (Exception e) {
// TODO: handle exception
}
return t;
}
public static List getPersons(String jsonString, Class cls) {
List list = new ArrayList();
try {
list = JSON.parseArray(jsonString, cls);
} catch (Exception e) {
}
return list;
}
public static List
List
try {
list = JSON.parseObject(jsonString,
new TypeReference>() {
});
} catch (Exception e) {
// TODO: handle exception
}
return list;
}
更多相关文章
- 2018年Android面经-BAT、头条、网易、爱奇艺、华为等等(上)
- Android(安卓)APK反编译详解
- 分享七个非常有用的Android开发工具和工具包
- 向大家推荐小专栏《Android 面试指南》,还可以内推
- Android 系列 6 图形用户界面 (GUI)
- Android面试系列文章2018之Android热更新篇
- 重大福利!!!《阿里巴巴Android开发手册》首次公开,免费参阅。
- android studio 添加阿里云仓库
- achartengine(Google给android提供的绘图工具包)的介绍和使用