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

com.alibaba.fastjson2.adapter.jackson.databind.ObjectCodecWrapper 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.JSONReader;
import com.alibaba.fastjson2.adapter.jackson.core.JsonParser;
import com.alibaba.fastjson2.adapter.jackson.core.ObjectCodec;
import com.alibaba.fastjson2.adapter.jackson.core.TreeNode;
import com.alibaba.fastjson2.adapter.jackson.databind.node.TreeNodeUtils;

import java.io.IOException;

public class ObjectCodecWrapper
        extends ObjectCodec {
    public ObjectCodecWrapper() {
    }

    @Override
    public  T readTree(JsonParser p) throws IOException {
        JSONReader jsonReader = p.getJSONReader();
        Object any = jsonReader.readAny();
        return (T) TreeNodeUtils.as(any);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy