@SuppressWarnings("unchecked")
public void validate(final Object value) throws ValidationException
{
final BeanValidationContext beanValidationContext = environment.peek(BeanValidationContext.class);
if (beanValidationContext == null)
{
return;
}
final Validator validator = validatorFactory.getValidator();
String currentProperty = beanValidationContext.getCurrentProperty();
if(currentProperty == null) return;
BeanDescriptor beanDescriptor = validator.getConstraintsForClass(beanValidationContext.getBeanType());
PropertyDescriptor propertyDescriptor = beanDescriptor.getConstraintsForProperty(currentProperty);
if(propertyDescriptor == null) return;
final Set<ConstraintViolation<Object>> violations = validator.validateValue(
(Class<Object>) beanValidationContext.getBeanType(), currentProperty,
value, beanValidationGroupSource.get());
if (violations.isEmpty())
{
return;