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

com.alibaba.fastjson2.adapter.jackson.databind.ser.std.StdSerializer Maven / Gradle / Ivy

There is a newer version: 2.0.26
Show newest version
package com.alibaba.fastjson2.adapter.jackson.databind.ser.std;

import com.alibaba.fastjson2.adapter.jackson.core.JsonGenerator;
import com.alibaba.fastjson2.adapter.jackson.databind.JavaType;
import com.alibaba.fastjson2.adapter.jackson.databind.JsonSerializer;
import com.alibaba.fastjson2.adapter.jackson.databind.SerializerProvider;

import java.io.IOException;

public abstract class StdSerializer
        extends JsonSerializer {
    protected final Class handledType;

    protected StdSerializer(Class t) {
        handledType = t;
    }

    protected StdSerializer(JavaType type) {
        handledType = (Class) type.getRawClass();
    }

    @Override
    public abstract void serialize(T value, JsonGenerator gen, SerializerProvider provider)
            throws IOException;

    @Override
    public Class handledType() {
        return handledType;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy