All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jd.blockchain.utils.serialize.json.JSONStringSerializer Maven / Gradle / Ivy

There is a newer version: 1.4.0.RELEASE
Show newest version
package com.jd.blockchain.utils.serialize.json;

import java.io.IOException;
import java.lang.reflect.Type;

import com.alibaba.fastjson.serializer.JSONSerializer;
import com.alibaba.fastjson.serializer.ObjectSerializer;
import com.alibaba.fastjson.serializer.SerializeWriter;

public class JSONStringSerializer implements ObjectSerializer {

	@Override
	public void write(JSONSerializer serializer, Object object, Object fieldName, Type fieldType, int features)
			throws IOException {
		SerializeWriter out = serializer.out;
		if (object == null) {
			out.writeNull();
			return;
		}
		JSONString jsonString = (JSONString) object;
		out.write(jsonString.toString());
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy