fastjson生成json时Null属性不显示

Fastjson的SerializerFeature序列化属性 --来自oschina bfleeee博客
QuoteFieldNames———-输出key时是否使用双引号,默认为true 
WriteMapNullValue——–是否输出值为null的字段,默认为false 
WriteNullNumberAsZero—-数值字段如果为null,输出为0,而非null 
WriteNullListAsEmpty—–List字段如果为null,输出为[],而非null 
WriteNullStringAsEmpty—字符类型字段如果为null,输出为”“,而非null 
WriteNullBooleanAsFalse–Boolean字段如果为null,输出为false,而非null。
 
/*     根据名称和类型查询小班信息      */     
@RequestMapping("/getSBInfo")     
@ResponseBody     
public Object getSBInfo(@RequestParam Map map) {
        JSONObject jsonArray = null;         
        if (map != null) {             
            //县、乡、村名称             
            String county = (String) map.get("county");             
            String town = (String) map.get("town");             
            String village = (String) map.get("village");             
            //类型是县、乡、村
            //"1"查询乡镇, "2"查询村, “3”查询全部
            String type = (String) map.get("type");
            if (county != null && town != null && village != null) {
                //查全部
                Map mapAll = stateCountyService.getAll(county, town, village);
                String str = JSON.toJSONString(mapAll,SerializerFeature.WriteMapNullValue);
                jsonArray = JSONObject.parseObject(str);
            } else if (county != null && town != null) {
                //查村
                Map mapVillage = stateCountyService.getVillge(county, town);
                String str = JSON.toJSONString(mapVillage,SerializerFeature.WriteMapNullValue);
                jsonArray = JSONObject.parseObject(str);
            } else if (county != null) {
                //查乡镇
                Map mapTown = stateCountyService.getTown(county);
                String str = JSON.toJSONString(mapTown,SerializerFeature.WriteMapNullValue);
                jsonArray = JSONObject.parseObject(str);
            }
        }
        return jsonArray;
    }