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

com.alibaba.fastjson2.adapter.jackson.databind.KeyDeserializer Maven / Gradle / Ivy

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

import com.alibaba.fastjson2.JSONException;
import com.alibaba.fastjson2.JSONReader;

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

public abstract class KeyDeserializer
        implements com.alibaba.fastjson2.reader.ObjectReader {
    @Override
    public Object readObject(JSONReader jsonReader, Type fieldType, Object fieldName, long features) {
        String str = jsonReader.readFieldName();
        DeserializationContext context = new DeserializationContext(fieldType, fieldName, features);
        try {
            return deserializeKey(str, context);
        } catch (IOException e) {
            throw new JSONException("deserializeKey error", e);
        }
    }

    public abstract Object deserializeKey(String key, DeserializationContext ctxt)
            throws IOException;

    public abstract static class None
            extends KeyDeserializer {
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy