final JsonGenerator generator) throws IOException
{
generator.writeArrayFieldStart(JsonTraceCodec.RELATIONSHIPS);
for (Map.Entry<Trace, Integer> entry : traceIds.entrySet())
{
final Trace trace = entry.getKey();
final int fromId = entry.getValue();
for (Related<Trace> related : trace.getRelated())
{
final int toId = traceIds.get(related.getRelated());
final String relationship = related.getRelationship();
generator.writeStartObject();
generator.writeStringField(JsonTraceCodec.RELATIONSHIP_RELATIONSHIP, relationship);