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

com.alibaba.fastjson.serializer.ObjectSerializer Maven / Gradle / Ivy

Go to download

Fastjson is a JSON processor (JSON parser + JSON generator) written in Java

There is a newer version: 2.0.53
Show newest version
package com.alibaba.fastjson.serializer;

import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson2.JSONWriter;
import com.alibaba.fastjson2.writer.ObjectWriter;

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

public interface ObjectSerializer
        extends ObjectWriter {
    @Override
    default void write(JSONWriter jsonWriter, Object object, Object fieldName, Type fieldType, long features) {
        JSONSerializer jsonSerializer = new JSONSerializer(jsonWriter);
        try {
            write(jsonSerializer, object, fieldName, fieldType, 0);
        } catch (IOException e) {
            throw new JSONException("write error", e);
        }
    }

    void write(
            JSONSerializer serializer,
            Object object,
            Object fieldName,
            Type fieldType,
            int features) throws IOException;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy