Package com.alibaba.fastjson

Examples of com.alibaba.fastjson.JSONAware


    public static JSONAwareSerializer instance = new JSONAwareSerializer();

    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType) throws IOException {
        SerializeWriter out = serializer.getWriter();

        JSONAware aware = (JSONAware) object;
        out.write(aware.toJSONString());
    }
View Full Code Here


        Assert.assertEquals("{}", serializer.getWriter().toString());
    }

    public void test_3() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(new JSONAware() {

            public String toJSONString() {
                return "null";
            }
        });
View Full Code Here

        Assert.assertEquals("null", serializer.getWriter().toString());
    }

    public void test_3_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(new JSONAware() {

            public String toJSONString() {
                return "null";
            }
        });
View Full Code Here

    public static JSONAwareSerializer instance = new JSONAwareSerializer();

    public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features) throws IOException {
        SerializeWriter out = serializer.getWriter();

        JSONAware aware = (JSONAware) object;
        out.write(aware.toJSONString());
    }
View Full Code Here

        Assert.assertEquals("{}", serializer.getWriter().toString());
    }

    public void test_3() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(new JSONAware() {

            public String toJSONString() {
                return "null";
            }
        });
View Full Code Here

        Assert.assertEquals("null", serializer.getWriter().toString());
    }

    public void test_3_s() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(new JSONAware() {

            public String toJSONString() {
                return "null";
            }
        });
View Full Code Here

TOP

Related Classes of com.alibaba.fastjson.JSONAware

Copyright © 2018 www.massapicom. 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.