org.zkoss.bind
Interface Converter<U,B,C extends Component>

All Known Implementing Classes:
AbstractListModelConverter, AbstractSelectedIndexConverter, BiglistboxSelectedIndexConverter, BiglistboxSelectedObjectConverter, ChildrenBindingConverter, ChosenboxModelConverter, ComboboxModelConverter, ComboboxSelectedIndexConverter, ComboboxSelectedItemConverter, ErrorMessageConverter, FormatedDateConverter, FormatedNumberConverter, GridModelConverter, ListboxModelConverter, ListboxSelectedIndexConverter, ListboxSelectedItemConverter, ListboxSelectedItemsConverter, ObjectBooleanConverter, RadiogroupModelConverter, RadiogroupSelectedIndexConverter, RadiogroupSelectedItemConverter, SelectboxModelConverter, SelectboxSelectedIndexConverter, SelectboxSelectedItemConverter, TabboxSelectedTabConverter, TreeModelConverter, TreeSelectedItemConverter, TreeSelectedItemsConverter, UriConverter

public interface Converter<U,B,C extends Component>

Generic binding conversion interface. U is the object type for the Component, B is the object type for the Bean and C is the component type of the converter.

Since:
6.0.0
Author:
henrichen, dennis

Field Summary
static java.lang.Object IGNORED_VALUE
          Indicates the returned value should be ignored to load to a component or save to a bean, It is useful for writing a converter to manipulate component directly when loading or saving Note :
If you want to return IGNORED_VALUE in the converter method, then you need to set U or B to Object.
 
Method Summary
 B coerceToBean(U val, C component, BindContext ctx)
          Coerces a value to bean value to save to a bean
 U coerceToUi(B val, C component, BindContext ctx)
          Coerces a value to another value to load to a component
 

Field Detail

IGNORED_VALUE

static final java.lang.Object IGNORED_VALUE
Indicates the returned value should be ignored to load to a component or save to a bean, It is useful for writing a converter to manipulate component directly when loading or saving Note :
If you want to return IGNORED_VALUE in the converter method, then you need to set U or B to Object.

Since:
6.0.1
Method Detail

coerceToUi

U coerceToUi(B val,
             C component,
             BindContext ctx)
Coerces a value to another value to load to a component

Parameters:
val - the bean value
component - the component to be loaded the value
ctx - the bind context
Returns:
the value to load to a component

coerceToBean

B coerceToBean(U val,
               C component,
               BindContext ctx)
Coerces a value to bean value to save to a bean

Parameters:
val - the value
component - the component provides the value
ctx - the bind context
Returns:
the value to save to a bean


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