@Override
public JSONObjectBuilder visitShape(Shape shape, Map<? extends Transition, ? extends Shape> transitions) {
JSONObjectBuilder sb = JSONHelper.object();
JSONArrayBuilder transitionarray = JSONHelper.array();
for (Entry<? extends Transition, ? extends Shape> entry : transitions.entrySet()) {
transitionarray.add(JSONHelper.object().add("transition", dumpTransition(entry.getKey())).add("successor", getId(entry.getValue())));
}
JSONArrayBuilder propertiesarray = JSONHelper.array();
for (Property p : shape.getPropertyList()) {
propertiesarray.add(dumpProperty(p));
}
sb.add("id", getId(shape));
sb.add("properties", propertiesarray);
sb.add("transitions", transitionarray);
sb.add("predecessor", shape.getParent() != null ? getId(shape.getParent()) : null);
sb.add("valid", shape.isValid());
return sb;
}