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

com.yishuifengxiao.common.tool.validate.NotNullList Maven / Gradle / Ivy

Go to download

本工具包主要集成了目前在项目开发过程中个人经常会使用到的一些工具类,对工具类进行了一下简单的封装

There is a newer version: 8.0.0
Show newest version
/**
 * 
 */
package com.yishuifengxiao.common.tool.validate;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import javax.validation.Constraint;
import javax.validation.Payload;

import com.yishuifengxiao.common.tool.validate.Password;

/**
 * 校验不是一个空的list,且不是一个只包含null的list
 * 
 * @author yishui
 * @date 2019年3月8日
 * @version 1.0.0
 */
@Target(value = { ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR,
		ElementType.ANNOTATION_TYPE })
@Retention(RetentionPolicy.RUNTIME)
// 指定验证器
@Constraint(validatedBy = NotNullListConstraintValidator.class)
@Documented
public @interface NotNullList {
	// 默认错误消息
	String message() default "集合不能为空";

	// 分组
	Class[] groups() default {};

	// 负载
	Class[] payload() default {};

	// 指定多个时使用
	@Target({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER, ElementType.CONSTRUCTOR,
			ElementType.ANNOTATION_TYPE })
	@Retention(RetentionPolicy.RUNTIME)
	@Documented
	@interface List {
		Password[] value();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy