final ObjectAdapter adapter = entityModel.getObject();
final ValidateObjectFacet facet = adapter.getSpecification().getFacet(ValidateObjectFacet.class);
if (facet == null) {
return;
}
final String invalidReasonIfAny = facet.invalidReason(adapter);
if (invalidReasonIfAny != null) {
Session.get().getFeedbackMessages()
.add(new FeedbackMessage(form, invalidReasonIfAny, FeedbackMessage.ERROR));
}
}