public static class One extends SelfDescribingMarshallable {
String text;
public One(String text) {
this.text = text;
}
}
public static class Two extends SelfDescribingMarshallable {
String text;
public Two(String text) {
this.text = text;
}
}
public static class Three extends SelfDescribingMarshallable {
private One one;
private Two two;
public Three() {
}
}
@Test
public void output() {
final Three three = new Three();
three.one = new One("hello");
three.two = new Two("world");
JSONWire wire = new JSONWire(Bytes.allocateElasticOnHeap())
.outputTypes(true);
System.out.println(wire.getValueOut()
.object(three));
}
Once Implemented, please write a one-page article on how to parse, typed java objects, to and from JSON. Please send this article to Carina and add it to chronicle wire docs.
issue https://github.com/OpenHFT/Chronicle-Wire/issues/322 introduces types to JSON wire, for example, the following code:
will output:
The requirement for this task is to be able to parse the JSON ( above), back to the java object graph, hence the reciprocal of https://github.com/OpenHFT/Chronicle-Wire/issues/322 which produces the JSON.
Once Implemented, please write a one-page article on how to parse, typed java objects, to and from JSON. Please send this article to Carina and add it to chronicle wire docs.