This interface defines methods for bean-centric data validation.
Validation is bound to subjects that have distinct names. Each subject
corresponds to a different variable, for example a property of a bean. When
a subject is found to be invalid, a corresponding instance of
ValidationError has to be registered.
ValidationError s indicate in detail why a
Validated object doesn't contain valid data. They should be
stored internally and can be manipulated by other classes that are able to
work with Validated objects. This makes it possible to collect
errors incrementally in one central place and to allow each component in a
system to perform its own part of the validation.
A Validated object has a
Validated.validate() validate() method which should be used to perform mandatory validation on subjects and
data that the object itself knows about. This validation has to perform all
checks that guarantee a coherent internal state of the data. Note that this
method should not reset the validation, but instead add new validation
errors to an already existing collection.
Since it's possible that subjects generate multiple
ValidationError s, it's possible to limit their number and only
store the first error that occurs for a particular subject.
author: Geert Bevin (gbevin[remove] at uwyn dot com) version: $Revision: 3634 $ See Also: ValidationError See Also: ValidationContext since: 1.0 |