Interface ValidatingField<E extends HasValue.ValueChangeEvent<V>,V> 
- Type Parameters:
- E- value change event type
- V- internal binder bean type
- All Superinterfaces:
- HasValue<E,,- V> - Serializable
- All Known Implementing Classes:
- BinderCustomField,- FieldBuilderCustomField,- NullableField
The main purpose of doing things this way is modularity: it allows a field to define its own validation logic, rather than relying on some external component to do so. Of course, this only works for validation checks that can be done by the field itself and are therefore independent of the containing context (e.g., other fields).
 This interface would typically be implemented by complex fields composed from sub-fields for which some overall validation
 is required. For example, imagine a date range field composed of two LocalDate fields representing the start
 and end date: an overall validation would require that the start date be prior to the end date.
 
 However, for any ValidatingField validation to take effect, some mechanism must register the validation with
 an appropriate Binder. This happens automatically for fields created by a FieldBuilder, but can also
 be done manually via addValidationTo().
- 
Nested Class SummaryNested classes/interfaces inherited from interface com.vaadin.flow.component.HasValueHasValue.ValueChangeEvent<V extends Object>, HasValue.ValueChangeListener<E extends HasValue.ValueChangeEvent<?>>
- 
Method SummaryModifier and TypeMethodDescriptiondefault <BEAN,TARGET extends V> 
 Binder.BindingBuilder<BEAN,TARGET> addValidationTo(Binder.BindingBuilder<BEAN, TARGET> builder) Add this instance as aValidatorto the given binding.validate(V value, ValueContext context) Validate this instance.Methods inherited from interface com.vaadin.flow.component.HasValueaddValueChangeListener, clear, getEmptyValue, getOptionalValue, getValue, isEmpty, isReadOnly, isRequiredIndicatorVisible, setReadOnly, setRequiredIndicatorVisible, setValue
- 
Method Details- 
validateValidate this instance.- Parameters:
- value- field value to validate
- context- the value context for validation
- Returns:
- the validation result
 
- 
addValidationTodefault <BEAN,TARGET extends V> Binder.BindingBuilder<BEAN,TARGET> addValidationTo(Binder.BindingBuilder<BEAN, TARGET> builder) Add this instance as aValidatorto the given binding.- Type Parameters:
- BEAN- binder bean type
- TARGET- binding target type
- Parameters:
- builder- binding builder
- Returns:
- updated binding builder
- Throws:
- IllegalArgumentException- if- builderis null
 
 
-