Java Code Examples for com.alibaba.fastjson.JSON#DEFAULT_GENERATE_FEATURE

The following examples show how to use com.alibaba.fastjson.JSON#DEFAULT_GENERATE_FEATURE . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
@Override
public byte[] encodeResponseData(Object data,RpcMethod rpcMethod) {
    if(data == null){
        return EMPTY;
    }

    try (SerializeWriter out = new SerializeWriter(null, JSON.DEFAULT_GENERATE_FEATURE,
            SERIALIZER_FEATURES)) {
        JSONSerializer serializer = new JSONSerializer(out, SerializeConfig.globalInstance);
        serializer.write(data);
        return out.toBytes(CHARSET_UTF8);
    }
}
 
Example 2
private TencentImPlugin(Context context, MethodChannel channel) {
    TencentImPlugin.context = context;
    TencentImPlugin.channel = channel;
    JSON.DEFAULT_GENERATE_FEATURE |= SerializerFeature.DisableCircularReferenceDetect.mask;
}
 
Example 3
Source Project: uavstack   File: SerializeWriter.java    License: Apache License 2.0 4 votes vote down vote up
public SerializeWriter(Writer writer){
    this(writer, JSON.DEFAULT_GENERATE_FEATURE, SerializerFeature.EMPTY);
}