@Override
public void appendLinks(LinkableRepresentation<?> representation) {
if(!(representation instanceof Identifiable)) {
return;
}
Identifiable sourceIdentifiable = (Identifiable)representation; // TODO: Remove need for cast
Collection<RelationMatch> matches = service.getMatchingRelations(representation.getSourceType());
for(RelationMatch target: matches) {
UriBuilder buidler = representation.getUriInfo().getBaseUriBuilder().segment(
"rel",
getTypeName(target.getSourceModel()),
sourceIdentifiable.getId(),
target.getSource().getType(),
getTypeName(target.getTargetModel()));
// TODO: Dynamically lookup MediaType
representation.addLink(