Sunday, March 20, 2011

Validator API (Methods)

validate

void validate(Object value)
              throws Validator.InvalidValueException
Checks the given value against this validator. If the value is valid the method does nothing. If the value is invalid, an Validator.InvalidValueException is thrown.

Parameters:
value - the value to check
Throws:
Validator.InvalidValueException - if the value is invalid

isValid

boolean isValid(Object value)
Tests if the given value is valid. This method must be symmetric with validate(Object) so that validate(Object) throws an error iff this method returns false.

Parameters:
value - the value to check
Returns:
true if the value is valid, false otherwise.

No comments:

Post a Comment