org.nico.cat.mvc.scan.annotations.Length Maven / Gradle / Ivy
package org.nico.cat.mvc.scan.annotations;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* Parameter Verfiy
*
* @author nico
* @version createTime:2018年3月25日 下午1:31:51
*/
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Inherited
@NV
public @interface Length {
/**
* If range is null, no verify range
* If range length is one, verify min
* If range length is two, verfiy min~max
* If range length is tow, and one = two, verfiy fixed number
* @return
*/
int[] range();
String message() default "Length range error";
}