org.zkoss.zkplus.databind
Class DataBinder

java.lang.Object
  extended by org.zkoss.zkplus.databind.DataBinder
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
AnnotateDataBinder

Deprecated. As of release 7.0.0, replace with new ZK binding.

public class DataBinder
extends java.lang.Object
implements java.io.Serializable

The DataBinder used for binding ZK UI component and the backend data bean.

Author:
Henri Chen
See Also:
Serialized Form

Field Summary
protected  java.util.Map<java.lang.String,CollectionItem> _collectionItemMap
          Deprecated.  
protected  java.util.Map<java.lang.String,CollectionItem> _collectionOwnerMap
          Deprecated.  
static java.lang.String ARGS
          Deprecated.  
static java.lang.String LOAD_ON_SAVE_TRIGGER_COMPONENT
          Deprecated.  
static java.lang.String NULLIFY
          Deprecated.  
static java.lang.String TEMPLATE
          Deprecated.  
static java.lang.String TEMPLATEMAP
          Deprecated.  
static java.lang.String VARNAME
          Deprecated.  
 
Constructor Summary
DataBinder()
          Deprecated.  
 
Method Summary
 void addBinding(Component comp, java.lang.String attr, java.lang.String expr)
          Deprecated. Binding bean to UI component.
 void addBinding(Component comp, java.lang.String attr, java.lang.String expr, java.util.List<java.lang.String> loadWhenEvents, java.util.List<java.lang.String> saveWhenEvents, java.lang.String access, java.lang.String converter)
          Deprecated. Binding bean to UI component.
 void addBinding(Component comp, java.lang.String attr, java.lang.String expr, java.util.List<java.lang.String> loadWhenEvents, java.util.List<java.lang.String> saveWhenEvents, java.lang.String access, java.lang.String converter, java.util.Map<java.lang.Object,java.lang.Object> args, java.util.List<java.lang.String> loadAfterEvents, java.util.List<java.lang.String> saveAfterEvents)
          Deprecated. Binding bean to UI component.
 void addBinding(Component comp, java.lang.String attr, java.lang.String expr, java.util.List<java.lang.String> loadWhenEvents, java.lang.String saveWhenEvent, java.lang.String access, java.lang.String converter)
          Deprecated. Binding bean to UI component.
 void addBinding(Component comp, java.lang.String attr, java.lang.String expr, java.lang.String[] loadWhenEvents, java.lang.String[] saveWhenEvents, java.lang.String access, java.lang.String converter)
          Deprecated. Binding bean to UI component.
 void addBinding(Component comp, java.lang.String attr, java.lang.String expr, java.lang.String[] loadWhenEvents, java.lang.String saveWhenEvent, java.lang.String access, java.lang.String converter)
          Deprecated. Binding bean to UI component.
 void addCollectionItem(java.lang.Class item, java.lang.Class owner, CollectionItem decor)
          Deprecated. Adds a CollectionItem for the specified item and owner component; e.g.
 void bindBean(java.lang.String beanid, java.lang.Object bean)
          Deprecated. Bind a real bean object to the specified beanid.
 boolean existBinding(Component comp, java.lang.String attr)
          Deprecated. Whether this component and attribute associated with a binding.
 boolean existsBindings(Component comp)
          Deprecated. Whether this component associated with any bindings.
 java.util.Collection<Binding> getAllBindings()
          Deprecated. Return all Bindings covered by this DataBinder
 Binding getBinding(Component comp, java.lang.String attr)
          Deprecated. Given component and attr, return the associated Binding.
protected  CollectionItem getBindingCollectionItem(Component comp)
          Deprecated. Returns a CollectionItem by the comp accordingly.
 java.util.Collection<Binding> getBindings(Component comp)
          Deprecated. Given component, return the associated list of Bindings.
protected  void init()
          Deprecated.  
 boolean isDefaultConfig()
          Deprecated. Whether use the default binding configuration.
 boolean isLoadOnSave()
          Deprecated. Returns whether this DataBinder shall do load-on-save automatically(default is true).
 void loadAll()
          Deprecated. Load all value from data beans to UI components.
 void loadAttribute(Component comp, java.lang.String attr)
          Deprecated. Load value from the data bean property to a specified attribute of the UI component.
 void loadComponent(Component comp)
          Deprecated. Load values from the data bean properties to all attributes of a specified UI component.
protected  java.lang.Object[] loadPropertyAnnotation(Component comp, java.lang.String propName, java.lang.String bindName)
          Deprecated.  
 void removeBinding(Component comp, java.lang.String attr)
          Deprecated. Remove the binding associated with the attribute of the component.
 void saveAll()
          Deprecated. Save all values from UI components to beans.
 void saveAttribute(Component comp, java.lang.String attr)
          Deprecated. Save value from a specified attribute of the UI component to a data bean property.
 void saveComponent(Component comp)
          Deprecated. Save values from all attributes of a specified UI component to data bean properties.
 void setDefaultConfig(boolean b)
          Deprecated. Whether use the default binding configuration.
 void setLoadOnSave(boolean b)
          Deprecated. Sets whether this DataBinder shall do load-on-save automatically.
 void setupTemplateComponent(Component comp, java.lang.Object owner)
          Deprecated. Sets up the specified comp and its descendants to be as template (or not)
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOAD_ON_SAVE_TRIGGER_COMPONENT

public static final java.lang.String LOAD_ON_SAVE_TRIGGER_COMPONENT
Deprecated. 
See Also:
Constant Field Values

NULLIFY

public static final java.lang.String NULLIFY
Deprecated. 
See Also:
Constant Field Values

ARGS

public static final java.lang.String ARGS
Deprecated. 
See Also:
Constant Field Values

VARNAME

public static final java.lang.String VARNAME
Deprecated. 
See Also:
Constant Field Values

TEMPLATEMAP

public static final java.lang.String TEMPLATEMAP
Deprecated. 
See Also:
Constant Field Values

TEMPLATE

public static final java.lang.String TEMPLATE
Deprecated. 
See Also:
Constant Field Values

_collectionItemMap

protected java.util.Map<java.lang.String,CollectionItem> _collectionItemMap
Deprecated. 

_collectionOwnerMap

protected java.util.Map<java.lang.String,CollectionItem> _collectionOwnerMap
Deprecated. 
Constructor Detail

DataBinder

public DataBinder()
Deprecated. 
Method Detail

setLoadOnSave

public void setLoadOnSave(boolean b)
Deprecated. 
Sets whether this DataBinder shall do load-on-save automatically.

Parameters:
b - true to have this DataBinder shall do load-on-save automatically.
Since:
5.0.4

isLoadOnSave

public boolean isLoadOnSave()
Deprecated. 
Returns whether this DataBinder shall do load-on-save automatically(default is true).

Returns:
whether this DataBinder shall do load-on-save automatically(default is true).
Since:
5.0.4

addBinding

public void addBinding(Component comp,
                       java.lang.String attr,
                       java.lang.String expr)
Deprecated. 
Binding bean to UI component. This is the same as addBinding(Component comp, String attr, String expr, (List)null, (List)null, (String)null, (String)null).

Parameters:
comp - The component to be associated.
attr - The attribute of the component to be associated.
expr - The expression to associate the data bean.

addBinding

public void addBinding(Component comp,
                       java.lang.String attr,
                       java.lang.String expr,
                       java.lang.String[] loadWhenEvents,
                       java.lang.String saveWhenEvent,
                       java.lang.String access,
                       java.lang.String converter)
Deprecated. 
Binding bean to UI component.

Parameters:
comp - The component to be associated.
attr - The attribute of the component to be associated.
expr - The expression to associate the data bean.
loadWhenEvents - The event list when to load data.
saveWhenEvent - The event when to save data.
access - In the view of UI component: "load" load only, "both" load/save, "save" save only when doing data binding. null means using the default access natural of the component. e.g. Label.value is "load", but Textbox.value is "both".
converter - The converter class used to convert classes between component and the associated bean. null means using the default class conversion method.

addBinding

public void addBinding(Component comp,
                       java.lang.String attr,
                       java.lang.String expr,
                       java.lang.String[] loadWhenEvents,
                       java.lang.String[] saveWhenEvents,
                       java.lang.String access,
                       java.lang.String converter)
Deprecated. 
Binding bean to UI component.

Parameters:
comp - The component to be associated.
attr - The attribute of the component to be associated.
expr - The expression to associate the data bean.
loadWhenEvents - The event list when to load data.
saveWhenEvents - The event when to save data.
access - In the view of UI component: "load" load only, "both" load/save, "save" save only when doing data binding. null means using the default access natural of the component. e.g. Label.value is "load", but Textbox.value is "both".
converter - The converter class used to convert classes between component and the associated bean. null means using the default class conversion method.
Since:
3.0.0

addBinding

public void addBinding(Component comp,
                       java.lang.String attr,
                       java.lang.String expr,
                       java.util.List<java.lang.String> loadWhenEvents,
                       java.lang.String saveWhenEvent,
                       java.lang.String access,
                       java.lang.String converter)
Deprecated. 
Binding bean to UI component.

Parameters:
comp - The component to be associated.
attr - The attribute of the component to be associated.
expr - The expression to associate the data bean.
loadWhenEvents - The event list when to load data.
saveWhenEvent - The event when to save data.
access - In the view of UI component: "load" load only, "both" load/save, "save" save only when doing data binding. null means using the default access natural of the component. e.g. Label.value is "load", but Textbox.value is "both".
converter - The converter class used to convert classes between component and the associated bean. null means using the default class conversion method.

addBinding

public void addBinding(Component comp,
                       java.lang.String attr,
                       java.lang.String expr,
                       java.util.List<java.lang.String> loadWhenEvents,
                       java.util.List<java.lang.String> saveWhenEvents,
                       java.lang.String access,
                       java.lang.String converter)
Deprecated. 
Binding bean to UI component.

Parameters:
comp - The component to be associated.
attr - The attribute of the component to be associated.
expr - The expression to associate the data bean.
loadWhenEvents - The event list when to load data.
saveWhenEvents - The event list when to save data.
access - In the view of UI component: "load" load only, "both" load/save, "save" save only when doing data binding. null means using the default access natural of the component. e.g. Label.value is "load", but Textbox.value is "both".
converter - The converter class used to convert classes between component and the associated bean. null means using the default class conversion method.
Since:
3.0.0

addBinding

public void addBinding(Component comp,
                       java.lang.String attr,
                       java.lang.String expr,
                       java.util.List<java.lang.String> loadWhenEvents,
                       java.util.List<java.lang.String> saveWhenEvents,
                       java.lang.String access,
                       java.lang.String converter,
                       java.util.Map<java.lang.Object,java.lang.Object> args,
                       java.util.List<java.lang.String> loadAfterEvents,
                       java.util.List<java.lang.String> saveAfterEvents)
Deprecated. 
Binding bean to UI component.

Parameters:
comp - The component to be associated.
attr - The attribute of the component to be associated.
expr - The expression to associate the data bean.
loadWhenEvents - The event list when to load data.
saveWhenEvents - The event list when to save data.
access - In the view of UI component: "load" load only, "both" load/save, "save" save only when doing data binding. null means using the default access natural of the component. e.g. Label.value is "load", but Textbox.value is "both".
converter - The converter class used to convert classes between component and the associated bean. null means using the default class conversion method.
args - generic argument map for each binding.
loadAfterEvents - the event list when to load data after.
saveAfterEvents - the event list when to save data after.
Since:
3.6.1

removeBinding

public void removeBinding(Component comp,
                          java.lang.String attr)
Deprecated. 
Remove the binding associated with the attribute of the component.

Parameters:
comp - The component to be removed the data binding association.
attr - The attribute of the component to be removed the data binding association.

getBinding

public Binding getBinding(Component comp,
                          java.lang.String attr)
Deprecated. 
Given component and attr, return the associated Binding.

Parameters:
comp - the concerned component
attr - the concerned attribute

getBindings

public java.util.Collection<Binding> getBindings(Component comp)
Deprecated. 
Given component, return the associated list of Bindings.

Parameters:
comp - the concerned component

getAllBindings

public java.util.Collection<Binding> getAllBindings()
Deprecated. 
Return all Bindings covered by this DataBinder

Returns:
all Bindings covered by this DataBinder.
Since:
3.5.2

existsBindings

public boolean existsBindings(Component comp)
Deprecated. 
Whether this component associated with any bindings.


existBinding

public boolean existBinding(Component comp,
                            java.lang.String attr)
Deprecated. 
Whether this component and attribute associated with a binding.


isDefaultConfig

public boolean isDefaultConfig()
Deprecated. 
Whether use the default binding configuration.


setDefaultConfig

public void setDefaultConfig(boolean b)
Deprecated. 
Whether use the default binding configuration.


bindBean

public void bindBean(java.lang.String beanid,
                     java.lang.Object bean)
Deprecated. 
Bind a real bean object to the specified beanid. You might not need to call this method because this DataBinder would look up the variable via the Component.getAttributeOrFellow(java.lang.String, boolean) method if it cannot find the specified bean via the given beanid.

Parameters:
beanid - The bean id used in data binding.
bean - The real bean object to be associated with the bean id.

loadAttribute

public void loadAttribute(Component comp,
                          java.lang.String attr)
Deprecated. 
Load value from the data bean property to a specified attribute of the UI component.

Parameters:
comp - the UI component to be loaded value.
attr - the UI component attribute to be loaded value.

saveAttribute

public void saveAttribute(Component comp,
                          java.lang.String attr)
Deprecated. 
Save value from a specified attribute of the UI component to a data bean property.

Parameters:
comp - the UI component used to save value into backend data bean.
attr - the UI component attribute used to save value into backend data bean.

loadComponent

public void loadComponent(Component comp)
Deprecated. 
Load values from the data bean properties to all attributes of a specified UI component.

Parameters:
comp - the UI component to be loaded value.

saveComponent

public void saveComponent(Component comp)
Deprecated. 
Save values from all attributes of a specified UI component to data bean properties.

Parameters:
comp - the UI component used to save value into backend data bean.

loadAll

public void loadAll()
Deprecated. 
Load all value from data beans to UI components.


saveAll

public void saveAll()
Deprecated. 
Save all values from UI components to beans.


loadPropertyAnnotation

protected java.lang.Object[] loadPropertyAnnotation(Component comp,
                                                    java.lang.String propName,
                                                    java.lang.String bindName)
Deprecated. 

init

protected void init()
Deprecated. 

addCollectionItem

public void addCollectionItem(java.lang.Class item,
                              java.lang.Class owner,
                              CollectionItem decor)
Deprecated. 
Adds a CollectionItem for the specified item and owner component; e.g. Listitem and Listbox, Row and Grid, Comoboitem and Combobox.

Parameters:
item - the item class
owner - the owner class
decor - the associated CollectionItem decorator
Since:
3.0.5
See Also:
CollectionItem

getBindingCollectionItem

protected CollectionItem getBindingCollectionItem(Component comp)
Deprecated. 
Returns a CollectionItem by the comp accordingly.

Since:
3.0.0
See Also:
CollectionItem

setupTemplateComponent

public void setupTemplateComponent(Component comp,
                                   java.lang.Object owner)
Deprecated. 
Sets up the specified comp and its descendants to be as template (or not)



Copyright © 2005-2011 Potix Corporation. All Rights Reserved. SourceForge.net Logo