Search in sources :

Example 11 with MediaContent

use of data.media.MediaContent in project jvm-serializers by eishay.

the class JacksonBsonDatabind method register.

public static void register(TestGroups groups) {
    JsonFactory f = new BsonFactory();
    ObjectMapper mapper = new ObjectMapper(f);
    mapper.registerModule(new BsonModule());
    groups.media.add(JavaBuiltIn.mediaTransformer, new DataBindBase<MediaContent>("bson/jackson/databind", MediaContent.class, mapper), new SerFeatures(SerFormat.BIN_CROSSLANG, SerGraph.FLAT_TREE, SerClass.CLASSES_KNOWN, ""));
}
Also used : BsonModule(de.undercouch.bson4jackson.BsonModule) MediaContent(data.media.MediaContent) BsonFactory(de.undercouch.bson4jackson.BsonFactory)

Example 12 with MediaContent

use of data.media.MediaContent in project jvm-serializers by eishay.

the class JacksonYAMLDatabind method register.

public static void register(TestGroups groups) {
    ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
    groups.media.add(JavaBuiltIn.mediaTransformer, new StdJacksonDataBind<MediaContent>("yaml/jackson/databind", MediaContent.class, mapper), new SerFeatures(SerFormat.JSON, SerGraph.FULL_GRAPH, SerClass.ZERO_KNOWLEDGE, ""));
}
Also used : YAMLFactory(com.fasterxml.jackson.dataformat.yaml.YAMLFactory) MediaContent(data.media.MediaContent) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 13 with MediaContent

use of data.media.MediaContent in project jvm-serializers by eishay.

the class MediaContentTemplate method read.

@Override
public MediaContent read(Unpacker unpacker, MediaContent to, boolean required) throws IOException {
    unpacker.readArrayBegin();
    to = new MediaContent(mediaTemplate.read(unpacker, null, true), imageListTemplate.read(unpacker, null, true));
    unpacker.readArrayEnd();
    return to;
}
Also used : MediaContent(data.media.MediaContent)

Example 14 with MediaContent

use of data.media.MediaContent in project jvm-serializers by eishay.

the class JacksonWithAfterburner method registerJSON.

public static void registerJSON(TestGroups groups) {
    ObjectMapper mapper = new ObjectMapper(new JsonFactory());
    mapper.registerModule(new AfterburnerModule());
    groups.media.add(JavaBuiltIn.mediaTransformer, new StdJacksonDataBind<MediaContent>("json/jackson+afterburner/databind", MediaContent.class, mapper), new SerFeatures(SerFormat.BINARY, SerGraph.FLAT_TREE, SerClass.ZERO_KNOWLEDGE, STD_DESC));
}
Also used : AfterburnerModule(com.fasterxml.jackson.module.afterburner.AfterburnerModule) JsonFactory(com.fasterxml.jackson.core.JsonFactory) MediaContent(data.media.MediaContent) SerFeatures(serializers.SerFeatures) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Example 15 with MediaContent

use of data.media.MediaContent in project jvm-serializers by eishay.

the class JacksonWithAfterburner method registerSmile.

public static void registerSmile(TestGroups groups, boolean shareNames, boolean shareValues) {
    SmileFactory f = new SmileFactory();
    f.configure(SmileGenerator.Feature.CHECK_SHARED_NAMES, shareNames);
    f.configure(SmileGenerator.Feature.CHECK_SHARED_STRING_VALUES, shareValues);
    ObjectMapper smileMapper = new ObjectMapper(f);
    smileMapper.registerModule(new AfterburnerModule());
    groups.media.add(JavaBuiltIn.mediaTransformer, new StdJacksonDataBind<MediaContent>("smile/jackson+afterburner/databind", MediaContent.class, smileMapper), new SerFeatures(SerFormat.BINARY, SerGraph.FLAT_TREE, SerClass.ZERO_KNOWLEDGE, STD_DESC));
}
Also used : AfterburnerModule(com.fasterxml.jackson.module.afterburner.AfterburnerModule) SmileFactory(com.fasterxml.jackson.dataformat.smile.SmileFactory) MediaContent(data.media.MediaContent) SerFeatures(serializers.SerFeatures) ObjectMapper(com.fasterxml.jackson.databind.ObjectMapper)

Aggregations

MediaContent (data.media.MediaContent)23 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)7 SerFeatures (serializers.SerFeatures)4 AfterburnerModule (com.fasterxml.jackson.module.afterburner.AfterburnerModule)3 Image (data.media.Image)3 Media (data.media.Media)2 ArrayList (java.util.ArrayList)2 XMLStreamReader (javax.xml.stream.XMLStreamReader)2 JSONLexer (com.alibaba.fastjson.parser.JSONLexer)1 SerializeConfig (com.alibaba.fastjson.serializer.SerializeConfig)1 SerializeWriter (com.alibaba.fastjson.serializer.SerializeWriter)1 JsonFactory (com.fasterxml.jackson.core.JsonFactory)1 JavaType (com.fasterxml.jackson.databind.JavaType)1 ObjectReader (com.fasterxml.jackson.databind.ObjectReader)1 ObjectWriter (com.fasterxml.jackson.databind.ObjectWriter)1 ArrayNode (com.fasterxml.jackson.databind.node.ArrayNode)1 AvroFactory (com.fasterxml.jackson.dataformat.avro.AvroFactory)1 AvroSchema (com.fasterxml.jackson.dataformat.avro.AvroSchema)1 CBORFactory (com.fasterxml.jackson.dataformat.cbor.CBORFactory)1 SmileFactory (com.fasterxml.jackson.dataformat.smile.SmileFactory)1