Provides validators for data contained in data-bound objects..
<!-- Put @see and @since tags down here. -->
Composite validator. This validator allows you to chain (compose) many validators to validate one field. The contained validators may be required to all validate the value to validate or it may be enough that one contained validator validates the value. This behaviour is controlled by the modes AND and OR.
3.0
Inheritance Path. java.lang.Object-> com.itmill.toolkit.data.validator.CompositeValidator
The validators are combined with AND clause: validity of the composite implies validity of the all validators it is composed of must be valid.
The validators are combined with and clause: validity of the composite implies validity of the all validators it is composed of
The validators are combined with OR clause: validity of the composite implies that some of validators it is composed of must be valid.
Get the error message for the composite validator. If the error message is null, original error messages of the sub-validators are used instead.
Parameters
Operation mode of the validator:
MODE_AND
or
MODE_OR
.
Get the mode of the validator.
Parameters
Collection of validators compatible with given type that must apply or null if none fould.
Get sub-validators by class.
If the component contains directly or recursively (it contains another composite containing the validator) validators compatible with given type they are returned. This only applies to AND mode composite validators.
If the validator is in OR mode or does not contain any validators of given type null is returned.
Check the validity of the the given value. The value is valid, if:
MODE_AND
: All of the sub-validators are valid
MODE_OR
: Any of the sub-validators are valid
Set the error message for the composite validator. If the error message is null, original error messages of the sub-validators are used instead.
Validate the the given value. The value is valid, if:
MODE_AND
: All of the sub-validators are valid
MODE_OR
: Any of the sub-validators are valid
If the value is invalid, validation error is thrown. If the error message is set (non-null), it is used. If the error message has not been set, the first error occurred is thrown.