BEAN - the bean typeTARGET - the target data type of the binding, matches the field type
unless a converter has been setpublic static interface Binder.Binding<BEAN,TARGET> extends Serializable
Binder.forField(HasValue)| Modifier and Type | Method and Description |
|---|---|
HasValue<?,?> |
getField()
Gets the field the binding uses.
|
ValueProvider<BEAN,TARGET> |
getGetter()
Gets the getter associated with this Binding.
|
Setter<BEAN,TARGET> |
getSetter()
Gets the setter associated with this Binding.
|
BindingValidationStatusHandler |
getValidationStatusHandler()
Gets the validation status handler for this Binding.
|
boolean |
isAsRequiredEnabled()
Returns whether asRequired validator is currently enabled or not.
|
boolean |
isReadOnly()
Gets the current read-only status for this Binding.
|
boolean |
isValidatorsDisabled()
Returns if validators are currently disabled or not.
|
void |
read(BEAN bean)
Reads the value from given item and stores it to the bound field.
|
void |
setAsRequiredEnabled(boolean asRequiredEnabled)
Enable or disable asRequired validator.
|
void |
setReadOnly(boolean readOnly)
Sets the read-only status on for this Binding.
|
void |
setValidatorsDisabled(boolean validatorsDisabled)
Define whether validators are disabled or enabled for this
specific binding.
|
void |
unbind()
Unbinds the binding from its respective
Binder. |
default BindingValidationStatus<TARGET> |
validate()
Validates the field value and returns a
ValidationStatus
instance representing the outcome of the validation. |
BindingValidationStatus<TARGET> |
validate(boolean fireEvent)
Validates the field value and returns a
ValidationStatus
instance representing the outcome of the validation. |
HasValue<?,?> getField()
default BindingValidationStatus<TARGET> validate()
ValidationStatus
instance representing the outcome of the validation. This method is a
short-hand for calling validate(boolean) with
fireEvent true.validate(boolean),
Binder.validate(),
Validator.apply(Object, ValueContext)BindingValidationStatus<TARGET> validate(boolean fireEvent)
ValidationStatus
instance representing the outcome of the validation.fireEvent - true to fire status event; false to notvalidate()BindingValidationStatusHandler getValidationStatusHandler()
void unbind()
Binder. Removes any
ValueChangeListener Registration from associated
HasValue.void read(BEAN bean)
bean - the bean to read fromvoid setReadOnly(boolean readOnly)
This helper method is the preferred way to control the read-only state of the bound field.
readOnly - true to set binding read-only; false to
enable writesIllegalStateException - if trying to make binding read-write and the setter is
nullboolean isReadOnly()
true if read-only; false if notsetReadOnly(boolean)ValueProvider<BEAN,TARGET> getGetter()
Setter<BEAN,TARGET> getSetter()
void setAsRequiredEnabled(boolean asRequiredEnabled)
asRequiredEnabled - false if asRequired validator should be disabled,
true otherwise (default)Binder.BindingBuilder.asRequired(String),
Binder.BindingBuilder.asRequired(ErrorMessageProvider)boolean isAsRequiredEnabled()
false if asRequired validator is disabled
true otherwise (default)Binder.BindingBuilder.asRequired(String),
Binder.BindingBuilder.asRequired(ErrorMessageProvider)void setValidatorsDisabled(boolean validatorsDisabled)
validatorsDisabled - A boolean value.boolean isValidatorsDisabled()
Copyright © 2000–2020 Vaadin Ltd. All rights reserved.