public interface FormValidatorResults
Definition of an interface for describing results of a form validation.
This interface is closely related to the
interface from the ValidationResult
transform
package. The difference is that
it does not represent results of a single field's validation, but can contain
multiple result objects for an arbitrary number of fields. So it can easily
be checked, which fields of a form are valid and which are not, and for
fields with invalid data the corresponding error messages can be retrieved.
Basically objects implementing this interface can be seen as composite
validation result objects. By providing the name of a field the corresponding
ValidationResult
object can be obtained. There are also
methods for testing if the whole validation was successful or for retrieving
only the names of the fields that contain invalid data.
Modifier and Type | Method and Description |
---|---|
Set<String> |
getErrorFieldNames()
Returns a set with the names of only those fields, for which validation
has failed.
|
Set<String> |
getFieldNames()
Returns a set with the names of all fields, for which result objects are
stored in this object.
|
ValidationResult |
getResultsFor(String field)
Returns the
ValidationResult object for the specified
field. |
boolean |
isValid()
Checks if the whole validation was successful.
|
boolean isValid()
Set<String> getFieldNames()
Set<String> getErrorFieldNames()
ValidationResult getResultsFor(String field)
ValidationResult
object for the specified
field. This object can then be used to check if validation of this field
was successful or to retrieve all available error messages.field
- the name of the desired fieldCopyright © 2016 The JGUIraffe Team. All rights reserved.