code: public String asJson(final ObjectSpecification objectSpec) {
          final LayoutMetadata metadata = new LayoutMetadata();
          metadata.setColumns(Lists.<ColumnRepr>newArrayList());
          
          final MemberGroupLayoutFacet mglf = objectSpec.getFacet(MemberGroupLayoutFacet.class);
          final ColumnSpans columnSpans = mglf.getColumnSpans();
          
          final Set<String> actionIdsForAssociations = Sets.newTreeSet();
          
          ColumnRepr columnRepr;
          
          columnRepr = addColumnWithSpan(metadata, columnSpans.getLeft());
          updateColumnMemberGroups(objectSpec, MemberGroupLayoutHint.LEFT, columnRepr);
          
          columnRepr = addColumnWithSpan(metadata, columnSpans.getMiddle());
          updateColumnMemberGroups(objectSpec, MemberGroupLayoutHint.MIDDLE, columnRepr);
          
          columnRepr = addColumnWithSpan(metadata, columnSpans.getRight());
          updateColumnMemberGroups(objectSpec, MemberGroupLayoutHint.RIGHT, columnRepr);
          
          columnRepr = addColumnWithSpan(metadata, columnSpans.getCollections());
          updateCollectionColumnRepr(objectSpec, columnRepr);
  
          addActions(objectSpec, metadata, actionIdsForAssociations);
          
          final Gson gson = new GsonBuilder().setPrettyPrinting().create();
          return gson.toJson(metadata);
      }
docs: not API