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 Removes any
ValueChangeListener Registration from associated
HasValue . |
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.
Note: Calling this method will not trigger the value
update in the bean automatically. This method will attempt to
temporarily apply all current changes to the bean and run full bean
validation for it. The changes are reverted after bean validation.fireEvent
- true
to fire status event; false
to notvalidate()
,
Binder.validate()
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
null
boolean 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)#asRequired(String)
,
#asRequired(ErrorMessageProvider)
boolean isAsRequiredEnabled()
false
if asRequired validator is disabled
true
otherwise (default)#asRequired(String)
,
#asRequired(ErrorMessageProvider)
void setValidatorsDisabled(boolean validatorsDisabled)
validatorsDisabled
- A boolean valueboolean isValidatorsDisabled()
Copyright © 2021 Vaadin Ltd. All rights reserved.