📜  springboot 验证器手动验证 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:19.703000             🧑  作者: Mango

代码示例1
Validator validator = Validation.buildDefaultValidatorFactory().getValidator();
        Set> violations = validator.validate( notionalProviderPaymentDTO );

        if(!violations.isEmpty()) {
            throw new ConstraintViolationException(violations);
        }