org.zkoss.zkplus.databind
Interface TypeConverter

All Known Implementing Classes:
CombboxListModelConverter, DateFormatConverter, ListboxListModelConverter, ListModelConverter, RadiogroupSelectedItemConverter, SelectboxListModelConverter, SelectedComboitemConverter, SelectedItemConverter, TabboxSelectedTabConverter

public interface TypeConverter

Converter to cast object class between UI Component attribute and backend data bean property. This interface is used in DataBinder. The implementation of this converter should not hold any state since it is shared by the whole application.

Author:
Henri Chen

Field Summary
static java.lang.Object IGNORE
          Special Value, when returned in coerceToBean(java.lang.Object, org.zkoss.zk.ui.Component) or coerceToUi(java.lang.Object, org.zkoss.zk.ui.Component), meaning ignore it.
 
Method Summary
 java.lang.Object coerceToBean(java.lang.Object val, Component comp)
          Convert an value object to bean property type.
 java.lang.Object coerceToUi(java.lang.Object val, Component comp)
          Convert an value object to UI component attribute type.
 

Field Detail

IGNORE

static final java.lang.Object IGNORE
Special Value, when returned in coerceToBean(java.lang.Object, org.zkoss.zk.ui.Component) or coerceToUi(java.lang.Object, org.zkoss.zk.ui.Component), meaning ignore it.

Method Detail

coerceToUi

java.lang.Object coerceToUi(java.lang.Object val,
                            Component comp)
Convert an value object to UI component attribute type.

Parameters:
val - the object to be corece to UI component attribute type.
comp - associated component
Returns:
the converted value suitable for assigning into UI compoenent attribute; or IGNORE if you want DataBinder to ignore the assignment.

coerceToBean

java.lang.Object coerceToBean(java.lang.Object val,
                              Component comp)
Convert an value object to bean property type.

Parameters:
val - the object to be corece to backend bean property type.
comp - associated component
Returns:
the converted value suitable for assigning into backend bean property; or IGNORE if you want DataBinder to ignore the assignment.


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