fastJson的feature和SerializerFeature属性的解释
< 返回列表时间: 2016-11-10来源:开源中国
HDC调试需求开发(15万预算),能者速来!>>>


package com.alibaba.fastjson.serializer;



public enum SerializerFeature {
QuoteFieldNames ,

UseSingleQuotes ,

WriteMapNullValue ,

WriteEnumUsingToString ,

WriteEnumUsingName ,

UseISO8601DateFormat ,

WriteNullListAsEmpty ,

WriteNullStringAsEmpty ,

WriteNullNumberAsZero ,

WriteNullBooleanAsFalse ,

SkipTransientField ,

SortField ,

@Deprecated
WriteTabAsSpecial ,

PrettyFormat ,

WriteClassName ,



DisableCircularReferenceDetect ,



WriteSlashAsSpecial ,



BrowserCompatible ,



WriteDateUseDateFormat ,



NotWriteRootClassName ,



DisableCheckSpecialChar ,



BeanToArray ,



WriteNonStringKeyAsString ,


NotWriteDefaultValue ,


BrowserSecure ,


IgnoreNonFieldGetter
;


SerializerFeature(){
mask = (1 << ordinal());
}


private final int mask ;


public final int getMask() {
return mask ;
}


public static boolean isEnabled( int features , SerializerFeature feature ) {
return ( features & feature .getMask()) != 0;
}

public static boolean isEnabled( int features , int fieaturesB , SerializerFeature feature ) {
int mask = feature .getMask();

return ( features & mask ) != 0 || ( fieaturesB & mask ) != 0;
}


public static int config( int features , SerializerFeature feature , boolean state ) {
if ( state ) {
features |= feature .getMask();
} else {
features &= ~ feature .getMask();
}


return features ;
}

public static int of(SerializerFeature[] features ) {
if ( features == null ) {
return 0;
}

int value = 0;

for (SerializerFeature feature : features ) {
value |= feature .getMask();
}

return value ;
}
} 上面是fastJson的转换和序列化的属性名,请问各位大神知不知道各个属性的具体作用啊,或者有文档的话发我看看,谢谢各位
热门排行