Examples of writeFieldValue()


Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeFieldValue()

   
    public void test_4() throws Exception {
        SerializeWriter out = new SerializeWriter(1);
        out.config(SerializerFeature.QuoteFieldNames, true);
        out.config(SerializerFeature.UseSingleQuotes, true);
        out.writeFieldValue(',', "name", (String) null);
        Assert.assertEquals(",'name':null", out.toString());
    }

}
View Full Code Here

Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeFieldValue()

public class SerializeWriterTest_3 extends TestCase {

    public void test_0() throws Exception {
        SerializeWriter out = new SerializeWriter(1);
        out.config(SerializerFeature.QuoteFieldNames, true);
        out.writeFieldValue(',', "name", "jobs");
        Assert.assertEquals(",\"name\":\"jobs\"", out.toString());
    }

    public void test_1() throws Exception {
        SerializeWriter out = new SerializeWriter(1);
View Full Code Here

Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeFieldValue()

    }

    public void test_1() throws Exception {
        SerializeWriter out = new SerializeWriter(1);
        out.config(SerializerFeature.QuoteFieldNames, false);
        out.writeFieldValue(',', "name", "jobs");
        Assert.assertEquals(",name:\"jobs\"", out.toString());
    }
   
    public void test_null() throws Exception {
        SerializeWriter out = new SerializeWriter(1);
View Full Code Here

Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeFieldValue()

    }
   
    public void test_null() throws Exception {
        SerializeWriter out = new SerializeWriter(1);
        out.config(SerializerFeature.QuoteFieldNames, true);
        out.writeFieldValue(',', "name", (String) null);
        Assert.assertEquals(",\"name\":null", out.toString());
    }

    public void test_null_1() throws Exception {
        SerializeWriter out = new SerializeWriter(1);
View Full Code Here

Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeFieldValue()

    }

    public void test_null_1() throws Exception {
        SerializeWriter out = new SerializeWriter(1);
        out.config(SerializerFeature.QuoteFieldNames, false);
        out.writeFieldValue(',', "name", (String) null);
        Assert.assertEquals(",name:null", out.toString());
    }
   

}
View Full Code Here

Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeFieldValue()

       
        SerializeWriter writer = new SerializeWriter(out, 10);
        writer.config(SerializerFeature.QuoteFieldNames, true);
        Assert.assertEquals(10, writer.getBufferLength());
       
        writer.writeFieldValue(',', "abcde01245abcde", 123);
        writer.close();
       
        String text = out.toString();
        Assert.assertEquals(",\"abcde01245abcde\":123", text);
    }
View Full Code Here

Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeFieldValue()

       
        SerializeWriter writer = new SerializeWriter(out, 10);
        writer.config(SerializerFeature.QuoteFieldNames, true);
        Assert.assertEquals(10, writer.getBufferLength());
       
        writer.writeFieldValue(',', "abcde01245abcde", 123L);
        writer.close();
       
        String text = out.toString();
        Assert.assertEquals(",\"abcde01245abcde\":123", text);
    }
View Full Code Here

Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeFieldValue()

        StringWriter out = new StringWriter();
       
        SerializeWriter writer = new SerializeWriter(out, 10);
        Assert.assertEquals(10, writer.getBufferLength());
       
        writer.writeFieldValue(',', "abcde01245abcde", true);
        writer.close();
       
        String text = out.toString();
        Assert.assertEquals(",\"abcde01245abcde\":true", text);
    }
View Full Code Here

Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeFieldValue()

       
        SerializeWriter writer = new SerializeWriter(out, 10);
        writer.config(SerializerFeature.QuoteFieldNames, true);
        Assert.assertEquals(10, writer.getBufferLength());
       
        writer.writeFieldValue(',', "abcde01245abcde", "123");
        writer.close();
       
        String text = out.toString();
        Assert.assertEquals(",\"abcde01245abcde\":\"123\"", text);
    }
View Full Code Here

Examples of com.alibaba.fastjson.serializer.SerializeWriter.writeFieldValue()

        StringWriter out = new StringWriter();
       
        SerializeWriter writer = new SerializeWriter(out, 10);
        Assert.assertEquals(10, writer.getBufferLength());
       
        writer.writeFieldValue(',', "abcde01245abcde", 123);
        writer.close();
       
        String text = out.toString();
        Assert.assertEquals(",abcde01245abcde:123", text);
    }
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.