Schnittstelle FormValidator
- Alle bekannten Implementierungsklassen:
ViewSettingsFormValidator
Definition of an interface for objects that can validate forms.
While a normal validator can check only single fields of a form a
FormValidator
can deal with a form as a whole and thus can evaluate complex
conditions and dependencies between the single elements.
This kind of validation takes places only after validation on both the field
and form level have succeeded. Validations performed by FormValidator
implementations are logically related to form level validations. The main
difference is that a FormValidator
can access all form fields at
once and so is able to check relations between fields, too.
Validation of a form as a whole is very specific and strongly depends on the
data fields contained in the form and its model. So there is no default base
implementation of this interface. A concrete implementation can access the
whole data that was entered into the form - either by querying the
FieldHandler
objects of the form or by calling the
Form.readFields(Object)
method passing in an appropriate data object
- and perform arbitrary checks.
- Version:
- $Id: FormValidator.java 205 2012-01-29 18:29:57Z oheger $
- Autor:
- Oliver Heger
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungValidates the specified form.
-
Methodendetails
-
isValid
Validates the specified form. When this method is invoked by the form framework it is guaranteed that field and form level validation have passed. Thus allFieldHandler
objects contained in the form have been initialized with the current data entered by the user. One way to obtain this data is by callinggetData()
on aFieldHandler
. An alternative is to callreadFields()
on theForm
object and let the data be copied into a corresponding model object. (This model object must of course be compatible with theBindingStrategy
used by theForm
.- Parameter:
form
- the form object to be validated- Gibt zurück:
- an object with validation results
-