BEAN - the bean type, must match the Binder bean typeFIELDVALUE - the value type of the fieldTARGET - the target data type of the binding, matches the field type
unless a converter has been setprotected static class Binder.BindingImpl<BEAN,FIELDVALUE,TARGET> extends Object implements Binder.Binding<BEAN,TARGET>
Binding.| Constructor and Description |
|---|
BindingImpl(Binder.BindingBuilderImpl<BEAN,FIELDVALUE,TARGET> builder,
ValueProvider<BEAN,TARGET> getter,
Setter<BEAN,TARGET> setter) |
| Modifier and Type | Method and Description |
|---|---|
protected ValueContext |
createValueContext()
Creates a value context from the current state of the binding and its
field.
|
protected Locale |
findLocale()
Finds an appropriate locale to be used in conversion and validation.
|
protected Binder<BEAN> |
getBinder()
Returns the
Binder connected to this Binding
instance. |
HasValue<FIELDVALUE> |
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()
Removes this binding from its binder and unregisters the
ValueChangeListener from any bound HasValue. |
BindingValidationStatus<TARGET> |
validate(boolean fireEvent)
Validates the field value and returns a
ValidationStatus
instance representing the outcome of the validation. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvalidatepublic BindingImpl(Binder.BindingBuilderImpl<BEAN,FIELDVALUE,TARGET> builder, ValueProvider<BEAN,TARGET> getter, Setter<BEAN,TARGET> setter)
public HasValue<FIELDVALUE> getField()
Binder.BindinggetField in interface Binder.Binding<BEAN,TARGET>protected Locale findLocale()
public BindingValidationStatus<TARGET> validate(boolean fireEvent)
Binder.BindingValidationStatus
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.validate in interface Binder.Binding<BEAN,TARGET>fireEvent - true to fire status event; false to notBinder.Binding.validate(),
Binder.validate()public void unbind()
ValueChangeListener from any bound HasValue. It does
nothing if it is called for an already unbound binding.unbind in interface Binder.Binding<BEAN,TARGET>protected ValueContext createValueContext()
protected Binder<BEAN> getBinder()
Binder connected to this Binding
instance.public BindingValidationStatusHandler getValidationStatusHandler()
Binder.BindinggetValidationStatusHandler in interface Binder.Binding<BEAN,TARGET>public void read(BEAN bean)
Binder.Bindingread in interface Binder.Binding<BEAN,TARGET>bean - the bean to read frompublic void setReadOnly(boolean readOnly)
Binder.BindingThis helper method is the preferred way to control the read-only state of the bound field.
setReadOnly in interface Binder.Binding<BEAN,TARGET>readOnly - true to set binding read-only; false to
enable writespublic boolean isReadOnly()
Binder.BindingisReadOnly in interface Binder.Binding<BEAN,TARGET>true if read-only; false if notBinder.Binding.setReadOnly(boolean)public ValueProvider<BEAN,TARGET> getGetter()
Binder.BindinggetGetter in interface Binder.Binding<BEAN,TARGET>public Setter<BEAN,TARGET> getSetter()
Binder.BindinggetSetter in interface Binder.Binding<BEAN,TARGET>public void setAsRequiredEnabled(boolean asRequiredEnabled)
Binder.BindingsetAsRequiredEnabled in interface Binder.Binding<BEAN,TARGET>asRequiredEnabled - false if asRequired validator should be disabled,
true otherwise (default)#asRequired(String),
#asRequired(ErrorMessageProvider)public boolean isAsRequiredEnabled()
Binder.BindingisAsRequiredEnabled in interface Binder.Binding<BEAN,TARGET>false if asRequired validator is disabled
true otherwise (default)#asRequired(String),
#asRequired(ErrorMessageProvider)public void setValidatorsDisabled(boolean validatorsDisabled)
Binder.BindingsetValidatorsDisabled in interface Binder.Binding<BEAN,TARGET>validatorsDisabled - A boolean valuepublic boolean isValidatorsDisabled()
Binder.BindingisValidatorsDisabled in interface Binder.Binding<BEAN,TARGET>Copyright © 2021 Vaadin Ltd. All rights reserved.