Search in sources :

Example 51 with SerializeConfig

use of com.alibaba.fastjson.serializer.SerializeConfig in project fastjson by alibaba.

the class SerializeEnumAsJavaBeanTest_manual method setUp.

protected void setUp() throws Exception {
    SerializeConfig serializeConfig = SerializeConfig.globalInstance;
    serializeConfig.configEnumAsJavaBean(OrderType.class);
}
Also used : SerializeConfig(com.alibaba.fastjson.serializer.SerializeConfig)

Example 52 with SerializeConfig

use of com.alibaba.fastjson.serializer.SerializeConfig in project fastjson by alibaba.

the class FeaturesTest method test_0.

public void test_0() throws Exception {
    SerializeConfig config = new SerializeConfig();
    config.setAsmEnable(false);
    String text = JSON.toJSONString(new Entity(), config);
    Assert.assertEquals("{\"value\":null}", text);
}
Also used : SerializeConfig(com.alibaba.fastjson.serializer.SerializeConfig)

Example 53 with SerializeConfig

use of com.alibaba.fastjson.serializer.SerializeConfig in project fastjson by alibaba.

the class FeaturesTest2 method test_1.

public void test_1() throws Exception {
    SerializeConfig config = new SerializeConfig();
    config.setAsmEnable(true);
    String text = JSON.toJSONString(new Entity(), config);
    Assert.assertEquals("{\"value\":0}", text);
}
Also used : SerializeConfig(com.alibaba.fastjson.serializer.SerializeConfig)

Example 54 with SerializeConfig

use of com.alibaba.fastjson.serializer.SerializeConfig in project fastjson by alibaba.

the class FeaturesTest3 method test_1.

public void test_1() throws Exception {
    SerializeConfig config = new SerializeConfig();
    config.setAsmEnable(true);
    String text = JSON.toJSONString(new Entity(), config);
    Assert.assertEquals("{\"value\":0}", text);
}
Also used : SerializeConfig(com.alibaba.fastjson.serializer.SerializeConfig)

Example 55 with SerializeConfig

use of com.alibaba.fastjson.serializer.SerializeConfig in project fastjson by alibaba.

the class FeaturesTest4 method test_1.

public void test_1() throws Exception {
    SerializeConfig config = new SerializeConfig();
    config.setAsmEnable(true);
    String text = JSON.toJSONString(new Entity(), config);
    Assert.assertEquals("{\"value\":\"\"}", text);
}
Also used : SerializeConfig(com.alibaba.fastjson.serializer.SerializeConfig)

Aggregations

SerializeConfig (com.alibaba.fastjson.serializer.SerializeConfig)191 Date (java.util.Date)16 ParserConfig (com.alibaba.fastjson.parser.ParserConfig)13 SimpleDateFormat (java.text.SimpleDateFormat)12 JSONSerializer (com.alibaba.fastjson.serializer.JSONSerializer)10 SimpleDateFormatSerializer (com.alibaba.fastjson.serializer.SimpleDateFormatSerializer)8 SerializeWriter (com.alibaba.fastjson.serializer.SerializeWriter)6 JavaBeanSerializer (com.alibaba.fastjson.serializer.JavaBeanSerializer)4 HashMap (java.util.HashMap)4 DoubleSerializer (com.alibaba.fastjson.serializer.DoubleSerializer)3 SerializerFeature (com.alibaba.fastjson.serializer.SerializerFeature)3 SimplePropertyPreFilter (com.alibaba.fastjson.serializer.SimplePropertyPreFilter)3 AfterFilter (com.alibaba.fastjson.serializer.AfterFilter)2 BeforeFilter (com.alibaba.fastjson.serializer.BeforeFilter)2 NameFilter (com.alibaba.fastjson.serializer.NameFilter)2 PascalNameFilter (com.alibaba.fastjson.serializer.PascalNameFilter)2 PropertyFilter (com.alibaba.fastjson.serializer.PropertyFilter)2 ValueFilter (com.alibaba.fastjson.serializer.ValueFilter)2 BigDecimal (java.math.BigDecimal)2 DecimalFormat (java.text.DecimalFormat)2