All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.kasinf.framework.rest.web.util.ValidatorUtils Maven / Gradle / Ivy

There is a newer version: 1.4.0
Show newest version
package com.kasinf.framework.rest.web.util;

import org.hibernate.validator.HibernateValidator;
import org.springframework.util.Assert;

import javax.validation.ConstraintViolation;
import javax.validation.Validation;
import javax.validation.Validator;
import java.util.Set;

/**
 * @author lkhsh
 * 

* 利用Hibernate Validator进行验证的工具类 */ public class ValidatorUtils { public static Validator validator; public ValidatorUtils(Validator validator) { ValidatorUtils.validator = validator; } public static Set> validate(Object target) { return validator.validate(target); } public static Set> validate(Object target, Class... groups) { return validator.validate(target, groups); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy