public interface FormValidator
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.
Modifier and Type | Method and Description |
---|---|
FormValidatorResults |
isValid(Form form)
Validates the specified form.
|
FormValidatorResults isValid(Form form)
FieldHandler
objects contained in the form have
been initialized with the current data entered by the user. One way to
obtain this data is by calling getData()
on a FieldHandler
. An alternative is to call readFields()
on the
Form
object and let the data be copied into a corresponding model
object. (This model object must of course be compatible with the
BindingStrategy
used by the Form
.form
- the form object to be validatedCopyright © 2016 The JGUIraffe Team. All rights reserved.