private static boolean applyConstraints(Set<ConstraintDescriptor<?>> constraintDescriptors,
Property property,
PropertyDescriptor propertyDesc,
Set<Class<?>> groups, boolean canApplyNotNull) {
boolean hasNotNull = false;
for (ConstraintDescriptor<?> descriptor : constraintDescriptors) {
if ( groups != null && Collections.disjoint( descriptor.getGroups(), groups) ) continue;
if ( canApplyNotNull ) {
hasNotNull = hasNotNull || applyNotNull( property, descriptor );
}
applyDigits( property, descriptor );
applySize( property, descriptor, propertyDesc );
applyMin( property, descriptor );
applyMax( property, descriptor );
applyLength( property, descriptor, propertyDesc );
hasNotNull = hasNotNull || applyConstraints(
descriptor.getComposingConstraints(),
property, propertyDesc, null,
canApplyNotNull );
}
return hasNotNull;
}