|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Validator
Interface that implements a method for validating if an Object
is
valid or not.
Implementors of this class can be added to any
Validatable
implementor to verify its
value.
validate(Object)
can be used to check if a value is valid. An
Validator.InvalidValueException
with an appropriate validation error message is
thrown if the value is not valid.
Validators must not have any side effects.
Since Vaadin 7, the method isValid(Object) does not exist in the interface -
validate(Object)
should be used instead, and the exception caught
where applicable. Concrete classes implementing Validator
can still
internally implement and use isValid(Object) for convenience or to ease
migration from earlier Vaadin versions.
Nested Class Summary | |
---|---|
static class |
Validator.EmptyValueException
A specific type of Validator.InvalidValueException that indicates that
validation failed because the value was empty. |
static class |
Validator.InvalidValueException
Exception that is thrown by a Validator when a value is invalid. |
Method Summary | |
---|---|
void |
validate(java.lang.Object value)
Checks the given value against this validator. |
Method Detail |
---|
void validate(java.lang.Object value) throws Validator.InvalidValueException
Validator.InvalidValueException
is thrown.
value
- the value to check
Validator.InvalidValueException
- if the value is invalid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |