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

com.jn.agileway.codec.serialization.cbor.CborJacksonCodec Maven / Gradle / Ivy

Go to download

Provide an unified codec API for hession, kryo, protostuff, fst, fes, xson, cbor, jackson, json, etc....

There is a newer version: 3.1.12
Show newest version
package com.jn.agileway.codec.serialization.cbor;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.dataformat.cbor.CBORFactory;
import com.jn.agileway.codec.serialization.jackson.BasedJacksonCodec;

/**
 * 基于Jackson框架实现,由于Jackson框架不支持循环依赖,因而导致 Cbor 目前的实现,不支持循环依赖。
 * @param 
 */
public class CborJacksonCodec extends BasedJacksonCodec {

    public CborJacksonCodec() {
        super(new ObjectMapper(new CBORFactory()));
    }

    public CborJacksonCodec(ClassLoader classLoader) {
        super(createObjectMapper(classLoader, new ObjectMapper(new CBORFactory())));
    }

    public CborJacksonCodec(ClassLoader classLoader, CborJacksonCodec codec) {
        super(createObjectMapper(classLoader, codec.objectMapper.copy()));
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy