0

我无法使用 Jackson 解析 json 数据:

{"query": "mydata","status": "true","user_info": "user_info": "{"userid":"212233379","org_id":"6335567"}"}

我的代码在下面

JsonFactory f = new JsonFactory();
        JsonParser jp = f.createJsonParser(is);
        jp.nextToken();

        while (jp.nextToken() != JsonToken.END_OBJECT) {

            if ("status".equals(jp.getCurrentName())) {
                status = jp.getText();
                jp.nextToken();
            } else if ("user_info".equals(jp.getCurrentName())) {

                    jp.nextToken();
                    while (jp.nextToken() != JsonToken.END_OBJECT) {
                        String namefieldOne = jp.getCurrentName();
                        jp.nextToken();
                        if ("userid".equals(namefieldOne)) {

                        } else if ("org_id".equals(namefieldOne)) {

                        } else {
                            throw new IllegalStateException("Unrecognized field '" + jp.getCurrentName() + "'!");
                        }

                }
            }
        }
        jp.close();

请帮忙

4

1 回答 1

0

This json seems to be invalid.

于 2013-03-26T17:47:25.060 回答