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 Type
    Method
    Description
    validate(Object value, Annotation constraint)
    Validate the given value against the supplied constraint
  • Method Details

    • validate

      ConstraintViolation validate(Object value, Annotation constraint)
      Validate the given value against the supplied constraint
      Parameters:
      value - the value that will be checked
      constraint - the constraint that the value will be checked against
      Returns:
      a ConstraintViolation object 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