Examples of JSONStreamAware


Examples of com.alibaba.fastjson.JSONStreamAware

    public static JSONStreamAwareSerializer instance = new JSONStreamAwareSerializer();

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

        JSONStreamAware aware = (JSONStreamAware) object;
        aware.writeJSONString(out);
    }
View Full Code Here

Examples of com.alibaba.fastjson.JSONStreamAware

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

    public void test_4() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(new JSONStreamAware() {

            public void writeJSONString(Appendable out) throws IOException {
                out.append("abc");
            }
        });
View Full Code Here

Examples of com.alibaba.fastjson.JSONStreamAware

        JSONException error = null;
        try {
            StringWriter out = new StringWriter();

            JSONSerializer serializer = new JSONSerializer();
            serializer.write(new JSONStreamAware() {

                public void writeJSONString(Appendable out) throws IOException {
                    throw new IOException();
                }
            });
View Full Code Here

Examples of com.alibaba.fastjson.JSONStreamAware

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

    public void test_4() throws Exception {
        JSONSerializer serializer = new JSONSerializer();
        serializer.write(new JSONStreamAware() {

            public void writeJSONString(Appendable out) throws IOException {
                out.append("abc");
            }
        });
View Full Code Here

Examples of com.alibaba.fastjson.JSONStreamAware

        JSONException error = null;
        try {
            StringWriter out = new StringWriter();

            JSONSerializer serializer = new JSONSerializer();
            serializer.write(new JSONStreamAware() {

                public void writeJSONString(Appendable out) throws IOException {
                    throw new IOException();
                }
            });
View Full Code Here

Examples of org.json.simple.JSONStreamAware

        final ReferencedEnvelope bounds = features.getBounds();
        final CoordinateReferenceSystem crs = bounds != null ? bounds.getCoordinateReferenceSystem() : null;

        if (bounds != null) {
            if (encodeFeatureCollectionBounds) {
                obj.put("bbox", new JSONStreamAware() {
                    public void writeJSONString(Writer out) throws IOException {
                        JSONArray.writeJSONString(Arrays.asList(bounds.getMinX(),
                                bounds.getMinY(), bounds.getMaxX(), bounds.getMaxY()), out);
                    }
                });
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.