Json解析
String text = {"base_resp":{"ret":10702,"err_msg":"can not send this type of msg"}}
JSON.parseObject(text, MsgJson.class)
public class MsgJson {Json
BaseResp base_resp = new BaseResp();
class BaseResp {
private int ret;
private String err_msg;
public int getRet() {
return ret;
}
public void setRet(int ret) {
this.ret = ret;
}
public String getMsg() {
return err_msg;
}
public void setMsg(String err_msg) {
this.err_msg = err_msg;
}
}
}