Interface ConstraintValidator<A extends java.lang.annotation.Annotation>
-
- Type Parameters:
A
- theConstraint
annotation this interface validates.
- All Known Implementing Classes:
NotBlankValidator
,RequiredValidator
,ValidHostValidator
,ValidPortValidator
public interface ConstraintValidator<A extends java.lang.annotation.Annotation>
Interface thatConstraint
annotations must implement to perform validation logic.- Since:
- 2.1
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
initialize(A annotation)
Called before this validator is used with the constraint annotation value.boolean
isValid(java.lang.String name, java.lang.Object value)
Indicates if the given value is valid.
-
-
-
Method Detail
-
initialize
void initialize(A annotation)
Called before this validator is used with the constraint annotation value.- Parameters:
annotation
- the annotation value this validator will be validating.
-
isValid
boolean isValid(java.lang.String name, java.lang.Object value)
Indicates if the given value is valid.- Parameters:
name
- the name to use for error reportingvalue
- the value to validate.- Returns:
true
if the given value is valid.
-
-