Interface ConstraintValidator
-
- All Known Implementing Classes:
FutureDateValidator,MaxDecimalValueValidator,MaxFloatValueValidator,MaxIntegerValueValidator,MaxLengthValidator,MinDecimalValueValidator,MinFloatValueValidator,MinIntegerValueValidator,MinLengthValidator,NotEmptyValidator,NotNullValidator,PastDateValidator,RegularExpressionValidator
public interface ConstraintValidatorA validator for annotation-based constraints. Validators may validate one or more constraint types.
Copyright 2010 (C) by Martin Ganserer
- Version:
- 1.0.0
- Author:
- Martin Ganserer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ConstraintViolationvalidate(Object value, Annotation constraint)Validate the given value against the supplied constraint
-
-
-
Method Detail
-
validate
ConstraintViolation validate(Object value, Annotation constraint)
Validate the given value against the supplied constraint- Parameters:
value- the value that will be checkedconstraint- the constraint that the value will be checked against- Returns:
- a
ConstraintViolationobject if there was a violation of the constraint, or null otherwise - Throws:
IllegalArgumentException- if the constraint is either null or not one of the constraint types supported by this validator
-
-