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, ""));
}
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, ""));
}
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;
}
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));
}
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));
}
Aggregations