com.google.gwt.validation.client.interfaces
Interface IConstraint<A extends java.lang.annotation.Annotation>

All Known Implementing Classes:
AssertFalseValidator, AssertTrueValidator, EmailValidator, FutureValidator, LengthValidator, MaxValidator, MinValidator, NotEmptyValidator, NotNullValidator, PastValidator, PatternValidator, RangeValidator, SizeValidator

public interface IConstraint<A extends java.lang.annotation.Annotation>

Define the logic to validate a given constraint
(Taken from JSR-303 example implementation in specification document.)


Method Summary
 void initialize(A constraintAnnotation)
          Initialize the constraint validator.
 void initialize(java.util.Map<java.lang.String,java.lang.String> propertyMap)
          Initialize the constraint validator, this is a "hack" for GWT initialization
 boolean isValid(java.lang.Object value)
          Evaluates the constraint against a value.
 

Method Detail

initialize

void initialize(A constraintAnnotation)
Initialize the constraint validator.

Parameters:
constraintAnnotation - The constraint declaration

initialize

void initialize(java.util.Map<java.lang.String,java.lang.String> propertyMap)
Initialize the constraint validator, this is a "hack" for GWT initialization

Parameters:
propertyMap -

isValid

boolean isValid(java.lang.Object value)
Evaluates the constraint against a value. This method must be thread safe.

Parameters:
value - The object to validate
Returns:
false if the value is not valid, true otherwise
Throws:
java.lang.IllegalArgumentException - The value's type isn't understood by the constraint validator