![JAR search and dependency download from the Maven repository](/logo.png)
com.alibaba.fastjson.serializer.ToStringSerializer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of fastjson-to-easyjson Show documentation
Show all versions of fastjson-to-easyjson Show documentation
Adapter alibaba fastjson to other json libraries. the fastjson version: 1.2.58
package com.alibaba.fastjson.serializer;
import java.io.IOException;
import java.lang.reflect.Type;
public class ToStringSerializer implements ObjectSerializer {
public static final ToStringSerializer instance = new ToStringSerializer();
@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;
}
String strVal = object.toString();
out.writeString(strVal);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy