private void passViolations(ConstraintValidatorContext context,
Set<ConstraintViolation<Object>> source) {
for (final ConstraintViolation<Object> violation : source) {
final Iterator<Node> nodeIter = violation.getPropertyPath()
.iterator();
final ConstraintViolationBuilder builder = context
.buildConstraintViolationWithTemplate(violation
.getMessageTemplate());
ConstraintValidatorContext nodeContext;
if (nodeIter.hasNext()) {
StringBuilder sb = new StringBuilder(nodeIter.next().getName());
if (supportsConstraintComposition) {
while (nodeIter.hasNext()) {
sb.append('.').append(nodeIter.next());
}
}
builder.addNode(sb.toString()).addConstraintViolation();
} else {
builder.addConstraintViolation();
}
}
}