解决方案 »
- hibernate连接sqlserver2008的
- 感觉myeclipse的jsp编辑器不太好用
- ssh2+dwr,出点问题,求助
- 通过httpClient向ftp远程服务器创建目录不成功(能上传),在本机器能够成功
- 使用JSTL自定义标签 属性值如何得到EL表达式的值?
- 在“Generating Artifacts”期间发生了内部错误。哪位高手能帮我看看!
- j2ee学习过程中的几个问题?
- 请指教(JSP页面问题)
- 大家来控讨一下,鄙人想开发一套企业级(大型)的应用系统。请问是构建在J2EE上好呢还是.NET上好?
- 位运算问题:为什么-1>>3 = -1,-1>>>3 = 536870911?
- SpringMvc报错求帮助啊,大神们
- 通讯录格式输出 算法求解
看了下,确实挺不错的,但是那个JsonValue是什么啊 能告知一下么
推荐你用fastjsonhttp://wenku.baidu.com/link?url=c3yYO-tQJBI1hjEvxKEd6dUnOniRTxBUmbk6cfZCBts7wmijvtRU5EZMceSBaM7go4q-c2SN5lmk4CNspQWkGfBPblDFQUJNxE6x7OicSuy
看了下,确实挺不错的,但是那个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;
}}