Interface Binding
- All Known Implementing Classes:
AbstractBinding
,AbstractPollingBinding
,BrokenBinding
,ExpressionBinding
,ExpressionStructureBinding
,HttpBinding
,PropertyBinding
,QueryBinding
public interface Binding
A binding is associated with a target property and shares the lifecycle of the component (or shorter, in the
designer-scope sessions). When created, a binding is given a consumer callback
BindingFactory.create(BindingContext, BindingConfig)
which it should call anytime it generates a value.
The callback may be invoked on or off-queue.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final QualifiedValue
static final QualifiedValue
static final String
Shared config key for storing bidirectional propertystatic final QualifiedValue
static final String
static final QualifiedValue
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
default void
onTargetUpdated
(PropertyTreeChangeEvent propertyChangeEvent) This will be called when the target property changes from a source other than the binding, if the binding returns true fromisBidirectional()
and there are no transforms present.void
Called to prompt the binding to produce a value as soon as possible.default Collection<PropertyReference>
void
shutdown()
Shut down the binding.void
startup()
Start up the binding.
-
Field Details
-
BIDIRECTIONAL_KEY
Shared config key for storing bidirectional property- See Also:
-
MDC_BINDING_TARGET
- See Also:
-
NOT_FOUND
-
BAD_REF
-
BAD_CONFIG
-
INITIAL_VALUE
-
-
Method Details
-
resolveReferences
-
startup
void startup()Start up the binding. Will be called on-queue -
shutdown
void shutdown()Shut down the binding. Will be called on-queue -
isBidirectional
default boolean isBidirectional()- Returns:
- true if this binding wants to be bidirectional. Note that if any transforms are present, then the binding will not operate in a bidirectional way.
-
onTargetUpdated
This will be called when the target property changes from a source other than the binding, if the binding returns true fromisBidirectional()
and there are no transforms present. -
onUserRefresh
void onUserRefresh()Called to prompt the binding to produce a value as soon as possible. This _not_ the normal way that bindings work. Bindings are expected to produce a value un-prompted after startup, and then again whenever they feel is appropriate. This is there to allow the user to call component.refreshBinding(property) and prompt a non-polling binding to run.
-