Interface ConstraintValidator<A extends Annotation>
- Type Parameters:
A- theConstraintannotation this interface validates.
- All Known Implementing Classes:
NotBlankValidator,RequiredValidator,ValidHostValidator,ValidPortValidator
public interface ConstraintValidator<A extends Annotation>
Interface that
Constraint annotations must implement to perform validation logic.- Since:
- 2.1
-
Method Summary
Modifier and TypeMethodDescriptionvoidinitialize(A annotation) Called before this validator is used with the constraint annotation value.booleanIndicates if the given value is valid.
-
Method Details
-
initialize
Called before this validator is used with the constraint annotation value.- Parameters:
annotation- the annotation value this validator will be validating.
-
isValid
Indicates if the given value is valid.- Parameters:
name- the name to use for error reportingvalue- the value to validate.- Returns:
trueif the given value is valid.
-