public static String encodeAsString(Object obj,NamingStyle namingStyle,boolean useUnicode){
		SerializeConfig config = SerializeConfig.getGlobalInstance();
		config.propertyNamingStrategy = getNamingStrategy(namingStyle);
		if(useUnicode){
			return JSON.toJSONString(obj,config,
							SerializerFeature.BrowserCompatible,
							SerializerFeature.WriteNullListAsEmpty,
							SerializerFeature.NotWriteDefaultValue
							);
		}
		return JSON.toJSONString(obj,config);
	}
public static String encodeAsString ( Object obj , NamingStyle namingStyle , boolean useUnicode ) { SerializeConfig config = SerializeConfig . getGlobalInstance ( ) ; config . propertyNamingStrategy = getNamingStrategy ( namingStyle ) ; if ( useUnicode ) { return JSON . toJSONString ( obj , config , SerializerFeature . BrowserCompatible , SerializerFeature . WriteNullListAsEmpty , SerializerFeature . NotWriteDefaultValue ) ; } return JSON . toJSONString ( obj , config ) ; }
将指定java对象序列化成相应字符串
@param obj java对象
@param namingStyle 命名风格
@param useUnicode 是否使用unicode编码（当有中文字段时）
@return 序列化后的json字符串
@author Zhanghongdong