Interface ConstraintValidator
- All Known Implementing Classes:
FutureDateValidator,MaxDecimalValueValidator,MaxFloatValueValidator,MaxIntegerValueValidator,MaxLengthValidator,MinDecimalValueValidator,MinFloatValueValidator,MinIntegerValueValidator,MinLengthValidator,NotEmptyValidator,NotNullValidator,PastDateValidator,RegularExpressionValidator
public interface ConstraintValidator
A 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
Modifier and TypeMethodDescriptionvalidate(Object value, Annotation constraint) Validate the given value against the supplied constraint
-
Method Details
-
validate
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
-