return representation;
}
private void addMembers() {
final JsonRepresentation membersList = JsonRepresentation.newArray();
representation.mapPut("members", membersList);
final List<ObjectAssociation> associations = objectSpecification.getAssociations();
for (final ObjectAssociation association : associations) {
if (association.isOneToOneAssociation()) {
final OneToOneAssociation property = (OneToOneAssociation) association;
final LinkBuilder linkBuilder = PropertyDescriptionReprRenderer.newLinkToBuilder(getResourceContext(), Rel.PROPERTY, objectSpecification, property);
membersList.arrayAdd(linkBuilder.build());
} else if (association.isOneToManyAssociation()) {
final OneToManyAssociation collection = (OneToManyAssociation) association;
final LinkBuilder linkBuilder = CollectionDescriptionReprRenderer.newLinkToBuilder(getResourceContext(), Rel.PROPERTY, objectSpecification, collection);
membersList.arrayAdd(linkBuilder.build());
}
}
final List<ObjectAction> actions = objectSpecification.getObjectActions(Contributed.INCLUDED);
for (final ObjectAction action : actions) {
final LinkBuilder linkBuilder = ActionDescriptionReprRenderer.newLinkToBuilder(getResourceContext(), Rel.ACTION, objectSpecification, action);
membersList.arrayAdd(linkBuilder.build());
}
}