惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

D
DataBreaches.Net
IT之家
IT之家
The Cloudflare Blog
Apple Machine Learning Research
Apple Machine Learning Research
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
阮一峰的网络日志
阮一峰的网络日志
P
Proofpoint News Feed
L
LangChain Blog
博客园 - Franky
美团技术团队
J
Java Code Geeks
Microsoft Security Blog
Microsoft Security Blog
博客园 - 叶小钗
小众软件
小众软件
Y
Y Combinator Blog
B
Blog RSS Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Docker
Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
Vercel News
Vercel News

博客园 - cyberghost

Padavan 路由器配置 Cloudflare DDNS Linux关闭占用特定端口的进程 Oracle SQL Developer更改DATE日期的显示格式 解决Navicat导入psc备份文件数据为空 Maven配置环境变量 org.hibernate.LazyInitializationException: could not initialize proxy - no Session Maven项目导出jar包 Eclipse配置Go语言开发环境(GoEclipse) Maven项目设置JDK版本 PowerDesigner16下载和破解 Ubuntu安装JDK配置环境变量 Ubuntu添加eclipse快捷方式 JDK配置环境变量 springMVC获得HttpServletRequest对象 Struts Action返回xml FusionCharts Free解决setDataURL中文乱码 使用FusionCharts Free显示图表(JSP) Ajax实现表单验证 Java判断指定日期是星期几
Jackson反序列化泛型List
cyberghost · 2015-07-21 · via 博客园 - cyberghost
ObjectMapper mapper = new ObjectMapper();
String json = "[{\"name\":\"a\",\"password\":\"345\"},{\"name\":\"b\",\"password\":\"123\"}]";
        
//第一种方法
List<User> list = mapper.readValue(json, new TypeReference<List<User>>(){/**/});
        
//第二种方法
JavaType javaType = mapper.getTypeFactory().constructCollectionType(List.class, User.class);
List<User> list2 = mapper.readValue(json, javaType);

posted @ 2015-07-21 15:58  cyberghost  阅读(2149)  评论(0)    收藏  举报