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

com.nls.validation.Required Maven / Gradle / Ivy

There is a newer version: 1.0.14
Show newest version
package com.nls.validation;

import javax.validation.Constraint;
import javax.validation.Payload;
import javax.validation.ReportAsSingleViolation;
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;

@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(validatedBy = RequiredValidator.class)
@ReportAsSingleViolation
public @interface Required {
    String message() default "This field is required";
    Class[] groups() default {};
    Class[] payload() default {};
    boolean trim() default true;

    @Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR, ElementType.PARAMETER})
    @Retention(RetentionPolicy.RUNTIME)
    @Documented
    @interface List {
        Required[] value();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy