abokchoy 最近的时间轴更新
abokchoy

abokchoy

V2EX 第 671967 号会员,加入于 2024-01-17 10:08:49 +08:00
abokchoy 最近回复了
289 天前
回复了 abokchoy 创建的主题 程序员 Java 求助
@gitdoit 多谢多谢
290 天前
回复了 abokchoy 创建的主题 程序员 Java 求助
```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);
}

```
反射拿了对象的类信息
290 天前
回复了 abokchoy 创建的主题 程序员 Java 求助
@Belmode 试了,不行
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2938 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 11ms · UTC 13:41 · PVG 21:41 · LAX 05:41 · JFK 08:41
Developed with CodeLauncher
♥ Do have faith in what you're doing.