Package com.alibaba.fastjson

Examples of com.alibaba.fastjson.JSONObject.toJSONString()


    public void test_for_issue() throws Exception {
        JSONObject j = new JSONObject();
        j.put("content",
              "爸爸去哪儿-第十期-萌娃比赛小猪快跑 爸爸上演\"百变大咖秀\"-【湖南卫视官方版1080P】20131213: http://youtu.be/ajvaXKAduJ4  via @youtube");
        System.out.println(j.toJSONString());
    }
}
View Full Code Here


        // mapping.put(User.class, new JavaBeanSerializer(User.class,
        // Collections.singletonMap("id", "uid")));

        JSONObject jsonObject = (JSONObject) JSON.toJSON(user);
        jsonObject.put("ext", "新加的属性");
        System.out.println(jsonObject.toJSONString(jsonObject, mapping));
    }

    public static class UserLog {

        private Long           id;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.