Package org.zkoss.bind
Interface Converter<U,B,C extends org.zkoss.zk.ui.Component>
- All Known Implementing Classes:
AbstractListModelConverter,AbstractSelectedIndexConverter,ChildrenBindingConverter,ComboboxModelConverter,ComboboxSelectedIndexConverter,ComboboxSelectedItemConverter,DefaultJSONBindingParamConverter,ErrorMessageConverter,FormatedDateConverter,FormatedNumberConverter,FormattedTemporalConverter,FormattedTimeConverter,GridModelConverter,ImageContentConverter,ListboxModelConverter,ListboxSelectedIndexConverter,ListboxSelectedItemConverter,ListboxSelectedItemsConverter,ObjectBooleanConverter,RadiogroupModelConverter,RadiogroupSelectedIndexConverter,RadiogroupSelectedItemConverter,SelectboxModelConverter,SelectboxSelectedIndexConverter,SelectboxSelectedItemConverter,TabboxModelConverter,TabboxSelectedIndexConverter,TabboxSelectedTabConverter,TreeModelConverter,TreeSelectedItemConverter,TreeSelectedItemsConverter,UriConverter
public interface Converter<U,B,C extends org.zkoss.zk.ui.Component>
Generic binding conversion interface.
U is the value type of the Component attribute, B is the property type of the Bean
and C is the component type of the converter.
- Since:
- 6.0.0
- Author:
- henrichen, dennis
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ObjectIndicates 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 returnIGNORED_VALUEin the converter method, then you need to set U or B to Object. -
Method Summary
Modifier and TypeMethodDescriptioncoerceToBean(U compAttr, C component, BindContext ctx) Coerces a value to bean value to save to a beancoerceToUi(B beanProp, C component, BindContext ctx) Coerces a value to another value to load to a component
-
Field Details
-
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 returnIGNORED_VALUEin the converter method, then you need to set U or B to Object.- Since:
- 6.0.1
-
-
Method Details
-
coerceToUi
Coerces a value to another value to load to a component- Parameters:
beanProp- the bean valuecomponent- the component to be loaded the valuectx- the bind context- Returns:
- the value to load to a component
-
coerceToBean
Coerces a value to bean value to save to a bean- Parameters:
compAttr- the value of component attribute.component- the component provides the valuectx- the bind context- Returns:
- the value to save to a bean
-