fengxiang
2018-01-04 8ca304e2e1b748f7ce16bcd664c12a193fe7fc95
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package com.moral;
 
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import org.junit.Test;
 
public class JavaBeanToJsonOutPrint {
    @Test
    public void jsonOutPrintTest(){
        String json = JSON.toJSONString(new com.moral.entity.Device(),
                SerializerFeature.WriteMapNullValue
                );
        System.out.printf("\n\n\n\n");
        System.out.printf(json);
        System.out.printf("\n\n\n\n");
    }
}