use of data.media.MediaContent in project jvm-serializers by eishay.
the class StaxSerializer method writeDocument.
public void writeDocument(XMLStreamWriter writer, MediaContent[] items) throws XMLStreamException {
writer.writeStartDocument("UTF-8", "1.0");
writer.writeStartElement(XmlStax.STREAM_ROOT);
for (MediaContent item : items) {
writeMediaContent(writer, item);
}
writer.writeEndElement();
writer.writeEndDocument();
}
use of data.media.MediaContent in project fastjson by alibaba.
the class ListFieldTest3 method test_typeRef.
public void test_typeRef() throws Exception {
String text = "{\"images\":[],\"media\":{\"width\":640}}";
MediaContent object = JSON.parseObject(text, MediaContent.class);
}
use of data.media.MediaContent in project fastjson by alibaba.
the class Case_Eishay method test_0.
public void test_0() throws Exception {
//JavaBeanMapping.getGlobalInstance().setAsmEnable(false);
System.out.println(text);
MediaContent object = JSON.parseObject(text, MediaContent.class);
String text2 = JSON.toJSONString(object, SerializerFeature.WriteEnumUsingToString);
System.out.println(text2);
System.out.println(JSON.toJSONString(JSON.parseObject(text2), true));
}
use of data.media.MediaContent in project jvm-serializers by eishay.
the class JBossMarshalling method register.
public static void register(final TestGroups groups) {
MarshallerFactory riverFactory = new RiverMarshallerFactory();
groups.media.add(JavaBuiltIn.mediaTransformer, new MarshallingSerializer<MediaContent>(MediaContent.class, "jboss-marshalling-river", riverFactory, false, false), new SerFeatures(SerFormat.BINARY, SerGraph.FULL_GRAPH, SerClass.ZERO_KNOWLEDGE, "full graph zero knowledge"));
groups.media.add(JavaBuiltIn.mediaTransformer, new MarshallingSerializer<MediaContent>(MediaContent.class, "jboss-marshalling-river-manual", riverFactory, false, true), new SerFeatures(SerFormat.BINARY, SerGraph.FULL_GRAPH, SerClass.MANUAL_OPT, "full graph with manual optimizations"));
groups.media.add(JavaBuiltIn.mediaTransformer, new MarshallingSerializer<MediaContent>(MediaContent.class, "jboss-marshalling-river-ct", riverFactory, true, false), new SerFeatures(SerFormat.BINARY, SerGraph.FULL_GRAPH, SerClass.CLASSES_KNOWN, "full graph with preregistered classes"));
groups.media.add(JavaBuiltIn.mediaTransformer, new MarshallingSerializer<MediaContent>(MediaContent.class, "jboss-marshalling-river-ct-manual", riverFactory, true, true), new SerFeatures(SerFormat.BINARY, SerGraph.FULL_GRAPH, SerClass.MANUAL_OPT, "full graph preregistered classes, manual optimization"));
groups.media.add(JavaBuiltIn.mediaTransformer, new MarshallingSerializer<MediaContent>(MediaContent.class, "jboss-marshalling-serial", new SerialMarshallerFactory(), false, false), new SerFeatures(SerFormat.BINARY, SerGraph.FULL_GRAPH, SerClass.ZERO_KNOWLEDGE, ""));
}
use of data.media.MediaContent in project jvm-serializers by eishay.
the class JacksonAvroDatabind method register.
public static void register(TestGroups groups) {
ObjectMapper mapper = new ObjectMapper(new AvroFactory());
mapper.enable(SerializationFeature.WRITE_ENUMS_USING_INDEX);
JavaType type = mapper.constructType(MediaContent.class);
AvroSchema schema = new AvroSchema(Avro.Media.sMediaContent);
ObjectReader reader = mapper.readerFor(type).with(schema);
ObjectWriter writer = mapper.writerFor(type).with(schema);
groups.media.add(JavaBuiltIn.mediaTransformer, new StdJacksonDataBind<MediaContent>("avro/jackson/databind", type, mapper, reader, writer), new SerFeatures(SerFormat.JSON, SerGraph.FLAT_TREE, SerClass.ZERO_KNOWLEDGE, ""));
}
Aggregations