public void checkAssociationConstraints(Association<?> association) throws ConstraintViolationException { if (associationConstraints != null) { List<ConstraintViolation> violations = associationConstraints.checkConstraints(association); if (!violations.isEmpty()) { throw new ConstraintViolationException( (Composite) association.get(), (Member) accessor, violations); } } }
@Override public void checkConstraints(Object value) throws ConstraintViolationException { if (constraints != null) { List<ConstraintViolation> violations = constraints.checkConstraints(value); if (!violations.isEmpty()) { Iterable<Class<?>> empty = empty(); throw new ConstraintViolationException("", empty, (Member) accessor, violations); } } }