开发者

Parsing string to Json in the Constructor

开发者 https://www.devze.com 2023-02-07 11:25 出处:网络
HY!! 开发者_Python百科 I have a Json class, so i will parse in the constructor the json string to JSonObject.

HY!!

开发者_Python百科

I have a Json class, so i will parse in the constructor the json string to JSonObject.

    public class JSONParse extends JSONObject  {

        public JSONParse(string json) {
//pseudo code
        this.obj = new JSONObject(EntityUtils.toString(json));
        }
    }

please help


I'm not 100% sure on what your question is, but I guess this is what you want?

public class JSONParse extends JSONObject  {
    public JSONParse(String json) throws JSONException {
        super(json);
    }
}


  • json java parser
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号