use of serializers.SerFeatures in project jvm-serializers by eishay.
the class JacksonCBORDatabind method register.
public static void register(TestGroups groups, boolean sharedNames, boolean sharedValues) {
CBORFactory factory = new CBORFactory();
// no point in using enum names with binary format, so:
ObjectMapper mapper = new ObjectMapper(factory);
groups.media.add(JavaBuiltIn.mediaTransformer, new StdJacksonDataBind<MediaContent>("cbor/jackson/databind", MediaContent.class, mapper), new SerFeatures(SerFormat.BIN_CROSSLANG, SerGraph.FLAT_TREE, SerClass.ZERO_KNOWLEDGE, ""));
groups.media.add(JavaBuiltIn.mediaTransformer, new JacksonJsonManual("cbor/jackson/manual", factory), new SerFeatures(SerFormat.BIN_CROSSLANG, SerGraph.FLAT_TREE, SerClass.MANUAL_OPT, ""));
}
use of serializers.SerFeatures in project jvm-serializers by eishay.
the class JacksonWithAfterburner method registerCBOR.
public static void registerCBOR(TestGroups groups) {
ObjectMapper mapper = new ObjectMapper(new CBORFactory());
mapper.registerModule(new AfterburnerModule());
groups.media.add(JavaBuiltIn.mediaTransformer, new StdJacksonDataBind<MediaContent>("cbor/jackson+afterburner/databind", MediaContent.class, mapper), new SerFeatures(SerFormat.BINARY, SerGraph.FLAT_TREE, SerClass.ZERO_KNOWLEDGE, STD_DESC));
}
use of serializers.SerFeatures in project jvm-serializers by eishay.
the class DSLPlatform method register.
public static void register(final TestGroups groups) {
groups.media.add(new DSLPlatformFullMediaTransformer(), new DSLPlatformFullSerializer(), new SerFeatures(SerFormat.JSON, SerGraph.FLAT_TREE, SerClass.CLASSES_KNOWN, "Serializes all properties with exact names."));
groups.media.add(new DSLPlatformMinifiedMediaTransformer(), new DSLPlatformMinifiedSerializer(), new SerFeatures(SerFormat.JSON, SerGraph.FLAT_TREE, SerClass.CLASSES_KNOWN, "JSON with minified property names and without default values."));
}
use of serializers.SerFeatures in project jvm-serializers by eishay.
the class Kryo method register.
private static <T, S> void register(TestGroup<T> group, Transformer<T, S> transformer, TypeHandler<S> handler) {
group.add(transformer, new DefaultSerializer<S>(handler, true, "kryo-serializer"), new SerFeatures(SerFormat.BINARY, SerGraph.FULL_GRAPH, SerClass.ZERO_KNOWLEDGE, "default"));
group.add(transformer, new DefaultSerializer<S>(handler, false, "kryo-flat"), new SerFeatures(SerFormat.BINARY, SerGraph.FLAT_TREE, SerClass.ZERO_KNOWLEDGE, "default, no shared refs"));
group.add(transformer, new BasicSerializer<S>(handler, "kryo-flat-pre"), new SerFeatures(SerFormat.BINARY, SerGraph.FLAT_TREE, SerClass.CLASSES_KNOWN, "no shared refs, preregistered classes"));
group.add(transformer, new OptimizedSerializer<S>(handler), new SerFeatures(SerFormat.BINARY, SerGraph.FLAT_TREE, SerClass.MANUAL_OPT, "manually optimized"));
group.add(transformer, new CustomSerializer<S>(handler), new SerFeatures(SerFormat.BINARY, SerGraph.FLAT_TREE, SerClass.MANUAL_OPT, "manually optimized"));
}
use of serializers.SerFeatures 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));
}
Aggregations