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

group.rxcloud.capa.addons.serialzer.ssjson.SSJsonDeserializers Maven / Gradle / Ivy

package group.rxcloud.capa.addons.serialzer.ssjson;

import com.fasterxml.jackson.databind.*;
import com.fasterxml.jackson.databind.deser.Deserializers;
import com.fasterxml.jackson.databind.jsontype.TypeDeserializer;
import com.fasterxml.jackson.databind.type.*;

import java.util.HashMap;

class SSJsonDeserializers extends Deserializers.Base {

    private final HashMap> deserializers = new HashMap<>();

    void addDeserializer(JavaType javaType, JsonDeserializer deserializer) {
        deserializers.put(javaType, deserializer);
    }

    private JsonDeserializer find(JavaType type) {
        return deserializers.get(type);
    }

    @Override
    public JsonDeserializer findReferenceDeserializer(ReferenceType refType, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer contentTypeDeserializer, JsonDeserializer contentDeserializer) throws JsonMappingException {
        return find(refType);
    }

    @Override
    public JsonDeserializer findBeanDeserializer(JavaType type, DeserializationConfig config, BeanDescription beanDesc) throws JsonMappingException {
        return find(type);
    }

    @Override
    public JsonDeserializer findArrayDeserializer(ArrayType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer elementDeserializer) throws JsonMappingException {
        return find(type);
    }

    @Override
    public JsonDeserializer findCollectionDeserializer(CollectionType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer elementDeserializer) throws JsonMappingException {
        return find(type);
    }

    @Override
    public JsonDeserializer findCollectionLikeDeserializer(CollectionLikeType type, DeserializationConfig config, BeanDescription beanDesc, TypeDeserializer elementTypeDeserializer, JsonDeserializer elementDeserializer) throws JsonMappingException {
        return find(type);
    }

    @Override
    public JsonDeserializer findMapDeserializer(MapType type, DeserializationConfig config, BeanDescription beanDesc, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, JsonDeserializer elementDeserializer) throws JsonMappingException {
        return find(type);
    }

    @Override
    public JsonDeserializer findMapLikeDeserializer(MapLikeType type, DeserializationConfig config, BeanDescription beanDesc, KeyDeserializer keyDeserializer, TypeDeserializer elementTypeDeserializer, JsonDeserializer elementDeserializer) throws JsonMappingException {
        return find(type);
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy