`
san_yun
  • 浏览: 2672115 次
  • 来自: 杭州
文章分类
社区版块
存档分类
最新评论

FASTJSON 增加对泛型的支持

    博客分类:
  • json
 
阅读更多
FASTJSON 默认没有开启对泛型的支持。通过SerializerFeature.WriteClassName增加

	Map<String, Date> map = new HashMap<String, Date>();
		map.put("now", new Date());

		String str = JSON.toJSONString(map,SerializerFeature.WriteClassName);
		System.out.println(str);
		Map<String, Date> result = JSON.parseObject(str, map.getClass());
		System.out.println(result.get("now").getClass());
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics