【发布时间】:2014-04-15 21:55:29
【问题描述】:
我有一个地图形式的 JSON 字符串:
{ “露西”:{ “身份证”:456, "full_name": "GOOBER, ANGELA", "user_id": "2733245678", “斯汀”:“2733212346” }, “迈拉”:{ “身份证”:123, "full_name": "鲍勃,史蒂夫", "user_id": "abc213", “斯汀”:“9040923411” } }
我想将其转换为 HashMap,键为“Lucy”、“Myra”等,值为 JavaObject
Class Person
{
String id;
String fullName;
String userId;
Strring stin;
}
我该怎么做?我有点暗示我需要使用 MapConverter,但是关于如何使用的文档很少。我使用 XStream 创建了列表(使用 addImplicitCollection),但不知道 Map。
【问题讨论】:
标签: java json hashmap converter xstream