The examples below are currently generated by the JON default writer. However, whitespace in the JON output has been added to aid readability.
A flattened java.lang.Object instance
&0 = (&1 = java.lang.Object)
{
}The sample class IntegerObject defined below
public class IntegerObject{
private int i;
}Could serialize to something like
&0 = (&1 = sample.IntegerObject)
{
i: 15
}public class SimpleObject{
private String s;
private IntegerObject io;
}&0 = (&1 = sample.SimpleObject)
{
s: "howdy",
io: &2 =
{
i: 17
}
}public class SelfReferencingObject{
private SelfReferencingObject self;
}&0 = (&1 = sample.SelfReferencingObject)
{
self: &0
}3456
null
public class SimpleChild extends SimpleObject{
private double s;
}&0 = (&1 = sample.SimpleChild)
{
s: 12.234
|
s: "curious",
io: &2 =
{
i: 181
}
}public class SimpleGrandChild extends SimpleChild{
}&0 = (&1 = sample.SimpleGrandChild)
{
s: 82.24
|
s: "bland",
io: &2 =
{
i: 134
}
}public class SimpleGreatGrandChild extends SimpleGrandChild{
private String[] s;
}&0 = (&1 = sample.SimpleGreatGrandChild)
{
s: &2 =
[
"crazy",
"train"
]
|
s: -82.24
|
s: "nested goodness",
io: &3 =
{
i: 1624
}
}public class ComplexChild extends SimpleChild{
}
public class IntegerChild extends IntegerObject{
private List<String> list;
}&0 = (&1 = sample.ComplexChild)
{
s: "wow",
io: &2 = (&3 = sample.IntegerChild)
{
list: &4 = (&5 = java.util.ArrayList)
[
"bob",
"was",
"here"
]
|
i: 19
}
}public class EnumBox{
public enum SampleEnum{
ValueA
}
private SampleEnum e;
}&0 = (&1 = sample.EnumBox)
{
e: ValueA
}public class InnerChild{
public class Child{
private int i;
}
private Child inner;
}&0 = (&1 = sample.InnerChild)
{
inner: &2 =
{
i: 1
}
}&0 = (&1 = java.util.HashMap)
{
"jon": "supercalifragilisticexpialidocious",
"json": "great",
"xml": "good"
}