abokchoy's recent timeline updates
abokchoy

abokchoy

V2EX member #671967, joined on 2024-01-17 10:08:49 +08:00
abokchoy's recent replies
Mar 8, 2024
Replied to a topic by abokchoy 程序员 Java 求助
@gitdoit 多谢多谢
Mar 7, 2024
Replied to a topic by 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);
}

```
反射拿了对象的类信息
Mar 7, 2024
Replied to a topic by abokchoy 程序员 Java 求助
@Belmode 试了,不行
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   4239 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 19ms · UTC 10:12 · PVG 18:12 · LAX 03:12 · JFK 06:12
♥ Do have faith in what you're doing.