info.joseluismartin.gui.bind
Class CompositeBinder<T>

java.lang.Object
  extended by info.joseluismartin.gui.bind.CompositeBinder<T>
Type Parameters:
T - model
All Implemented Interfaces:
BinderHolder, Binder<T>, ModelHolder<T>

public class CompositeBinder<T>
extends Object
implements Binder<T>, BinderHolder

Composite Binder methods to a collection of PropertyBinders that bind on the same model

Author:
Jose Luis Martin - (jlm@joseluismartin.info)

Constructor Summary
CompositeBinder()
          Create new CompositeBinder
CompositeBinder(T model)
           
 
Method Summary
 void addBinder(Binder<?> binder, String name)
           
 void addBinder(String propertyName, PropertyBinder binder)
           
 void autobind(Object view)
           
 void bind(Object component, String propertyName)
           
 void bind(Object component, String propertyName, boolean readOnly)
           
 void bind(Object component, String propertyName, T model, boolean readOnly)
           
 PropertyBinder getBinder(String propertyName)
          Lookup for a binder by property name
 BinderFactory getBinderFactory()
           
 org.springframework.validation.BindingResult getBindingResult()
          Get binding result
 List<String> getIgnoredProperties()
           
 T getModel()
          Gets model
 Collection<Binder<T>> getPropertyBinders()
           
 Set<String> getPropertyNames()
           
 void ignoreProperty(String propertyName)
          Add a property name to ignore on binding.
 void refresh()
          Update Component from model
 void setBinderFactory(BinderFactory binderFactory)
           
 void setIgnoredProperties(List<String> ignoredProperties)
           
 void setModel(T model)
          Sets model
 void update()
          Update Model from Component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeBinder

public CompositeBinder()
Create new CompositeBinder


CompositeBinder

public CompositeBinder(T model)
Parameters:
model - model to bind on
Method Detail

bind

public void bind(Object component,
                 String propertyName)

bind

public void bind(Object component,
                 String propertyName,
                 boolean readOnly)

bind

public void bind(Object component,
                 String propertyName,
                 T model,
                 boolean readOnly)

addBinder

public void addBinder(String propertyName,
                      PropertyBinder binder)

refresh

public void refresh()
Description copied from interface: Binder
Update Component from model

Specified by:
refresh in interface Binder<T>

addBinder

public void addBinder(Binder<?> binder,
                      String name)

update

public void update()
Description copied from interface: Binder
Update Model from Component

Specified by:
update in interface Binder<T>

getBinder

public PropertyBinder getBinder(String propertyName)
Description copied from interface: BinderHolder
Lookup for a binder by property name

Specified by:
getBinder in interface BinderHolder
Parameters:
propertyName - property name
Returns:
PropertyBinder or null if none

getPropertyNames

public Set<String> getPropertyNames()

getPropertyBinders

public Collection<Binder<T>> getPropertyBinders()

getBinderFactory

public BinderFactory getBinderFactory()
Returns:
the binderFactory

setBinderFactory

public void setBinderFactory(BinderFactory binderFactory)
Parameters:
binderFactory - the binderFactory to set

getModel

public T getModel()
Description copied from interface: ModelHolder
Gets model

Specified by:
getModel in interface ModelHolder<T>
Returns:
the model

setModel

public void setModel(T model)
Description copied from interface: ModelHolder
Sets model

Specified by:
setModel in interface ModelHolder<T>

getBindingResult

public org.springframework.validation.BindingResult getBindingResult()
Get binding result

Specified by:
getBindingResult in interface Binder<T>
Returns:
the binding result

autobind

public void autobind(Object view)

getIgnoredProperties

public List<String> getIgnoredProperties()
Returns:
the ignoredProperties

setIgnoredProperties

public void setIgnoredProperties(List<String> ignoredProperties)
Parameters:
ignoredProperties - the ignoredProperties to set

ignoreProperty

public void ignoreProperty(String propertyName)
Add a property name to ignore on binding.

Parameters:
propertyName - property name to ignore


Copyright © 2013 JDAL. All Rights Reserved.