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

io.dropwizard.validation.ValidationMethod Maven / Gradle / Ivy

There is a newer version: 0.40.13
Show newest version
package io.dropwizard.validation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.ANNOTATION_TYPE;
import static java.lang.annotation.ElementType.METHOD;
import static java.lang.annotation.ElementType.TYPE;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * Validates a bean predicate method as returning true. Bean predicates must be of the form
 * {@code isSomething} or they'll be silently ignored.
 */
@Target({TYPE, ANNOTATION_TYPE, METHOD})
@Retention(RUNTIME)
@Constraint(validatedBy = MethodValidator.class)
@Documented
public @interface ValidationMethod {
    String message() default "is not valid";

    Class[] groups() default {};

    @SuppressWarnings("UnusedDeclaration") Class[] payload() default { };
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy