@Override
protected ApplicationAdvice appliesTo(final IModel<?> model) {
if (!(model instanceof EntityModel)) {
return ApplicationAdvice.DOES_NOT_APPLY;
}
final EntityModel entityModel = (EntityModel) model;
final ObjectAdapter adapter = entityModel.getObject();
if (adapter == null) {
// is ok;
}
final ObjectSpecification specification = entityModel.getTypeOfSpecification();
final boolean isObject = specification.isNotCollection();
final boolean isValue = specification.containsFacet(ValueFacet.class);
return appliesIf(isObject && !isValue);
}