```java
public final <T> Set<ConstraintViolation<T>> validate(T object, Class<?>... groups) {
Contracts.assertNotNull(object, Messages.MESSAGES.validatedObjectMustNotBeNull());
ValidationContext<T> validationContext = this.getValidationContextBuilder().forValidate(object);
if (!validationContext.getRootBeanMetaData().hasConstraints()) {
return Collections.emptySet();
} else {
ValidationOrder validationOrder = this.determineGroupValidationOrder(groups);
ValueContext<?, Object> valueContext = ValueContext.getLocalExecutionContext(this.parameterNameProvider, object, validationContext.getRootBeanMetaData(), PathImpl.createRootPath());
return this.validateInContext(validationContext, valueContext, validationOrder);
}
}
public <T> ValidationContext<T> forValidate(T rootBean) {
Class<T> rootBeanClass = rootBean.getClass();
return new ValidationContext(this.constraintValidatorManager, this.messageInterpolator, this.constraintValidatorFactory, this.traversableResolver, (ExecutableParameterNameProvider)null, this.clockProvider, this.failFast, rootBean, rootBeanClass, this.beanMetaDataManager.getBeanMetaData(rootBeanClass), (Executable)null, (Object[])null, (Object)null);
}
```
反射拿了对象的类信息