JSON字符串如何转List和地图集合

JSON字符串怎么转List和map集合啊
现在有一个需求,老大要我将拿到的json字符串转成list集合 和 map集合。 不知道咋整
------解决思路----------------------
下个Gson包
------解决思路----------------------
我写过一个这样的互转, 你去看看吧http://blog.csdn.net/moneyshi/article/details/24986125
------解决思路----------------------
看你要用什么了,Gson,Jackson,fastjson
推荐你用fastjsonhttp://wenku.baidu.com/link?url=c3yYO-tQJBI1hjEvxKEd6dUnOniRTxBUmbk6cfZCBts7wmijvtRU5EZMceSBaM7go4q-c2SN5lmk4CNspQWkGfBPblDFQUJNxE6x7OicSuy
------解决思路----------------------
引用:
Quote: 引用:

我写过一个这样的互转, 你去看看吧http://blog.csdn.net/moneyshi/article/details/24986125


看了下,确实挺不错的,但是那个JsonValue是什么啊 能告知一下么


额....硬要贴代码么?


好吧,全给你。
import java.util.HashMap;
import java.util.List;


public class JsonValue {
private String value;
private HashMap<String,JsonValue> map;
private List<HashMap<String,JsonValue>> list;
private Boolean bool;

public JsonValue(){
}

public JsonValue(String value){
setValue(value);
}

public JsonValue(Integer value){
setValue(StringUtil.valueOf(value));
}

public JsonValue(Long value){
setValue(String.valueOf(value));
}

public JsonValue(Boolean bool){
setBool(bool);
}

public JsonValue(HashMap<String, JsonValue>  map){
setMap(map);
}

public JsonValue(List<HashMap<String, JsonValue>> list){
setList(list);
}

public String getValue() {
return value;
}

public void setValue(String value) {
this.value = value;
}

public HashMap<String, JsonValue> getMap() {
return map;
}

public void setMap(HashMap<String, JsonValue> map) {
this.map = map;
}

public List<HashMap<String, JsonValue>> getList() {
return list;
}

public void setList(List<HashMap<String, JsonValue>> list) {
this.list = list;
}

public Boolean getBool() {
return bool;
}

public void setBool(Boolean bool) {
this.bool = bool;
}

public Class getValueType(){
if(getValue() != null){
return getValue().getClass();
}
if(getMap() != null){
return getMap().getClass();
}
if(getList() != null){
return getList().getClass();
}
if(getBool() != null){
return getBool().getClass();
}
return null;
}

public Object getJsonValue(){
if(getValue() != null){
return getValue();
}
if(getMap() != null){
return getMap();
}
if(getList() != null){
return getList();
}
if(getBool() != null){
return getBool();
}
return null;
}

}