org.zkoss.zkplus.databind
Class Binding

java.lang.Object
  extended by org.zkoss.zkplus.databind.Binding
All Implemented Interfaces:
java.io.Serializable

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

A Data Binding that associate component+attr to an bean expression.

Since:
3.0.0
Author:
Henri
See Also:
Serialized Form

Method Summary
 java.util.Set getAfterWhenEvents()
          Get save-after event expression.
 java.util.Map<java.lang.Object,java.lang.Object> getArgs()
          Get generic arguments.
 java.lang.String getAttr()
          Get component attribute name.
 java.lang.Object getBean(Component comp)
          Returns the associated bean of this binding; e.g., for a binding to the bean "a.b.c", this will return the bean associated to "a.b" (and c is the property name).
 DataBinder getBinder()
          Gets the associated Data Binder of this Binding.
 Component getComponent()
          Gets the associated Component of this Binding.
 TypeConverter getConverter()
          Get the TypeConverter.
 java.lang.String getExpression()
          Get bean expression, e.g. a.b.c.
 java.util.LinkedHashSet<java.lang.String> getLoadAfterEvents()
          Get load-after event expression set.
 java.util.LinkedHashSet<java.lang.String> getLoadWhenEvents()
          Get load-when event expression set.
 java.util.Set<java.lang.String> getSaveWhenEvents()
          Get save-when event expression.
 boolean isLoadable()
          Whether the binding is loadable.
 boolean isSavable()
          Whether the binding is savable.
 void loadAttribute(Component comp)
          load bean value into the attribute of the specified component.
 void loadAttribute(Component comp, java.lang.Object bean)
          load bean value into the attribute of the specified component.
 void saveAttribute(Component comp)
          save into bean value from the attribute of the specified component.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getBinder

public DataBinder getBinder()
Gets the associated Data Binder of this Binding.


getComponent

public Component getComponent()
Gets the associated Component of this Binding.


getAttr

public java.lang.String getAttr()
Get component attribute name.


getArgs

public java.util.Map<java.lang.Object,java.lang.Object> getArgs()
Get generic arguments.


getExpression

public java.lang.String getExpression()
Get bean expression, e.g. a.b.c.


getSaveWhenEvents

public java.util.Set<java.lang.String> getSaveWhenEvents()
Get save-when event expression.


getAfterWhenEvents

public java.util.Set getAfterWhenEvents()
Get save-after event expression.


getLoadWhenEvents

public java.util.LinkedHashSet<java.lang.String> getLoadWhenEvents()
Get load-when event expression set.


getLoadAfterEvents

public java.util.LinkedHashSet<java.lang.String> getLoadAfterEvents()
Get load-after event expression set.


isLoadable

public boolean isLoadable()
Whether the binding is loadable.


isSavable

public boolean isSavable()
Whether the binding is savable.


getConverter

public TypeConverter getConverter()
Get the TypeConverter.


loadAttribute

public void loadAttribute(Component comp)
load bean value into the attribute of the specified component.

Parameters:
comp - the component.

getBean

public java.lang.Object getBean(Component comp)
Returns the associated bean of this binding; e.g., for a binding to the bean "a.b.c", this will return the bean associated to "a.b" (and c is the property name).

Note if the expression is associated to a single variable; e.g. "a" only, this method returns null.

Parameters:
comp -
Returns:
the associated bean of this binding.
Since:
5.0.7

loadAttribute

public void loadAttribute(Component comp,
                          java.lang.Object bean)
load bean value into the attribute of the specified component.

Parameters:
comp - the component.
bean - the bean value.

saveAttribute

public void saveAttribute(Component comp)
save into bean value from the attribute of the specified component.

Parameters:
comp - the component.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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