public class DefaultFormComponentBinder extends AbstractBinder implements FormComponentBinder
| Constructor and Description |
|---|
DefaultFormComponentBinder(FormContainer form)
Creates a binder for a form.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBinding(Binding binding) |
protected void |
addChangeableBinding(Binding changeableBinding)
Adds a changeable binding.
|
protected void |
addMandatoryBinding(Binding mandatoryBinding)
Adds a mandatory binding.
|
void |
assertAllBound() |
int |
bind() |
int |
bindAllInherited() |
int |
bindWithInheritedBindables()
Binds with bindable inheritance.
|
int |
bindWithInheritedComponents()
Binds with form inheritance.
|
protected int |
doBind(BindingMember[] parents,
String parentMemberPath,
Class<?> parentClass,
boolean declaredOnly)
Binds an object to a form.
|
void |
fireToModel(Binding binding,
Object parent,
Object viewValue) |
void |
fireToView(Binding binding,
Object parent,
Object modelValue) |
FormComponentBinding |
getBinding(FormComponent component)
Gets a binding by component.
|
FormComponentBinding |
getBinding(String bindingPath) |
Collection<? extends Binding> |
getBindings() |
Collection<FormComponent> |
getBoundComponents()
Gets the list of all bound components of this form.
|
List<? extends Binding> |
getChangeableBindings()
Gets the dynamically changeable bindings.
|
FormContainer |
getFormContainer()
Gets the container bound by this binder.
|
List<? extends Binding> |
getMandatoryBindings()
Gets the dynamically mandatory bindings.
|
Collection<FormComponent> |
getUnboundComponents()
Gets the list of all unbound components of this form.
|
boolean |
isUnboundPending()
Checks whether some components are still unbound.
|
FormComponentBinding |
removeBinding(FormComponent component)
Programmatically removes a binding from this form.
|
FormComponentBinding |
removeBinding(String bindingPath) |
void |
requestChangeableUpdate()
Request to update the changeable attribute of all dynamically mandatory components.
Used by FormContainer.setFormValues() and FormContainer.setFormValuesKeepChanged(). |
void |
requestMandatoryUpdate()
Request to update the mandatory attribute of all dynamically mandatory components.
Used by FormContainer.setFormValues() and FormContainer.setFormValuesKeepChanged(). |
void |
unbind() |
addToModelListener, addToViewListener, addValidationListener, compareTo, equals, fireValidated, getBindingProperty, getBindingProperty, getInstanceNumber, getToModelListeners, getToViewListeners, getValidationListeners, getValidationScope, hashCode, putBindingProperty, removeToModelListener, removeToViewListener, removeValidationListener, setValidationScopeclone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitaddToModelListener, addToViewListener, addValidationListener, fireValidated, getBindingProperty, getBindingProperty, getInstanceNumber, getToModelListeners, getToViewListeners, getValidationListeners, getValidationScope, putBindingProperty, removeToModelListener, removeToViewListener, removeValidationListener, setValidationScopecompareTopublic DefaultFormComponentBinder(FormContainer form)
form - the form to bindpublic FormContainer getFormContainer()
FormComponentBindergetFormContainer in interface FormComponentBinderpublic void fireToView(Binding binding, Object parent, Object modelValue) throws BindingVetoException
fireToView in interface BinderfireToView in class AbstractBinderBindingVetoExceptionpublic void fireToModel(Binding binding, Object parent, Object viewValue) throws BindingVetoException
fireToModel in interface BinderfireToModel in class AbstractBinderBindingVetoExceptionpublic void requestMandatoryUpdate()
FormComponentBinderFormContainer.setFormValues() and FormContainer.setFormValuesKeepChanged().requestMandatoryUpdate in interface FormComponentBinderpublic List<? extends Binding> getMandatoryBindings()
FormComponentBindergetMandatoryBindings in interface FormComponentBinderpublic void requestChangeableUpdate()
FormComponentBinderFormContainer.setFormValues() and FormContainer.setFormValuesKeepChanged().requestChangeableUpdate in interface FormComponentBinderpublic List<? extends Binding> getChangeableBindings()
FormComponentBindergetChangeableBindings in interface FormComponentBinderpublic int bindAllInherited()
bindAllInherited in interface Binderpublic int bindWithInheritedBindables()
FormComponentBinder
The form will be scanned for members or submembers
annotated with the Bindable-annotation.
Inherited members of all bindables will be included as well.
Notice that the object references are not kept in the binding.
CAUTION: expensive operation!
bindWithInheritedBindables in interface FormComponentBinderpublic int bindWithInheritedComponents()
FormComponentBinder
The form will be scanned for members or submembers
annotated with the Bindable-annotation.
Inherited members of the form's parent classes
will be included as well.
Notice that the object references are not kept in the binding.
CAUTION: expensive operation!
bindWithInheritedComponents in interface FormComponentBinderpublic Collection<? extends Binding> getBindings()
getBindings in interface Binderpublic Collection<FormComponent> getBoundComponents()
FormComponentBindergetBoundComponents in interface FormComponentBinderpublic boolean isUnboundPending()
public Collection<FormComponent> getUnboundComponents()
FormComponentBindergetUnboundComponents in interface FormComponentBinderpublic void assertAllBound()
throws BindingException
assertAllBound in interface BinderBindingExceptionpublic void addBinding(Binding binding)
addBinding in interface Binderpublic FormComponentBinding getBinding(FormComponent component)
FormComponentBindergetBinding in interface FormComponentBindercomponent - the component assigned to the bindingpublic FormComponentBinding getBinding(String bindingPath)
FormComponentBinderOverridden to cast.
getBinding in interface BindergetBinding in interface FormComponentBinderpublic FormComponentBinding removeBinding(FormComponent component)
FormComponentBinderremoveBinding in interface FormComponentBindercomponent - the component assigned to the bindingpublic FormComponentBinding removeBinding(String bindingPath)
FormComponentBinderOverridden to cast.
removeBinding in interface BinderremoveBinding in interface FormComponentBinderprotected void addMandatoryBinding(Binding mandatoryBinding)
mandatoryBinding - the binding to addprotected void addChangeableBinding(Binding changeableBinding)
changeableBinding - the binding to addprotected int doBind(BindingMember[] parents, String parentMemberPath, Class<?> parentClass, boolean declaredOnly)
The object will be scanned for members or submembers
annotated with the Bindable-annotation and their
corresponding setter- and getter methods.
More than one object can be bound to a form.
Notice that the object reference is not kept in the binding, i.e. the binding works only by declaration (reflection).
doBind in class AbstractBinderparents - the fields building the declaration chain to this field, null if containerparentMemberPath - the object path prefix, null if rootparentClass - the object's classdeclaredOnly - true if search for methods and field which are declared only,
false to include inherited as wellTentackle - distributed, domain- and model-driven