}
final private static ValidationInfo getValidationInfo(BeanValidationContext beanValidationContext, String currentProperty, Validator validator) {
Class<?> beanType = beanValidationContext.getBeanType();
String[] path = currentProperty.split("\\.");
BeanDescriptor beanDescriptor = validator.getConstraintsForClass(beanType);
for (int i = 1; i < path.length - 1; i++)
{
Class<?> constrainedPropertyClass = getConstrainedPropertyClass(beanDescriptor, path[i]);
if (constrainedPropertyClass != null) {
beanType = constrainedPropertyClass;
beanDescriptor = validator.getConstraintsForClass(beanType);
}
}
final String propertyName = path[path.length - 1];
PropertyDescriptor propertyDescriptor = beanDescriptor.getConstraintsForProperty(propertyName);
return new ValidationInfo(beanType, propertyName, propertyDescriptor);
}