Package org.zkoss.bind.converter.sys
Class AbstractListModelConverter<C extends Component>
- java.lang.Object
-
- org.zkoss.bind.converter.sys.AbstractListModelConverter<C>
-
- All Implemented Interfaces:
java.io.Serializable
,Converter<java.lang.Object,java.lang.Object,C>
- Direct Known Subclasses:
ChosenboxModelConverter
,ComboboxModelConverter
,GridModelConverter
,ListboxModelConverter
,RadiogroupModelConverter
,SearchboxModelConverter
,SelectboxModelConverter
,TabboxModelConverter
public abstract class AbstractListModelConverter<C extends Component> extends java.lang.Object implements Converter<java.lang.Object,java.lang.Object,C>, java.io.Serializable
The abstractConverter
implementation for converting collection to ListModel and vice versa.- Since:
- 6.0.0
- Author:
- dennis
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.zkoss.bind.Converter
IGNORED_VALUE
-
-
Constructor Summary
Constructors Constructor Description AbstractListModelConverter()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description java.lang.Object
coerceToBean(java.lang.Object val, C comp, BindContext ctx)
Convert aListModel
to Set, Map, List, or ListModel (itself).java.lang.Object
coerceToUi(java.lang.Object val, C comp, BindContext ctx)
Convert a Set, Map, List, Object[], Enum, or other kind of ListModel to associatedListModel
.protected abstract ListModel<?>
getComponentModel(C comp)
protected ListModel<?>
handleWrappedModel(BindContext ctx, C comp, ListModel<?> model)
post processing the wrapped model. default return original one
-
-
-
Method Detail
-
getComponentModel
protected abstract ListModel<?> getComponentModel(C comp)
- Parameters:
comp
- the component that has listmodel- Returns:
- null if no list model for the component
-
handleWrappedModel
protected ListModel<?> handleWrappedModel(BindContext ctx, C comp, ListModel<?> model)
post processing the wrapped model. default return original one- Parameters:
ctx
- the contextcomp
- the component of the convertermodel
- the wrapped model- Returns:
- the list model
-
coerceToUi
public java.lang.Object coerceToUi(java.lang.Object val, C comp, BindContext ctx)
Convert a Set, Map, List, Object[], Enum, or other kind of ListModel to associatedListModel
.- Specified by:
coerceToUi
in interfaceConverter<java.lang.Object,java.lang.Object,C extends Component>
- Parameters:
val
- must be instanceof Set, Map, List, Object[], Enum Class, or other kind of ListModel implementation.comp
- associated componentctx
- bind context- Returns:
- the value to load to a component
-
coerceToBean
public java.lang.Object coerceToBean(java.lang.Object val, C comp, BindContext ctx)
Convert aListModel
to Set, Map, List, or ListModel (itself).- Specified by:
coerceToBean
in interfaceConverter<java.lang.Object,java.lang.Object,C extends Component>
- Parameters:
val
- must be ListModelSet, ListModelList, ListModelMap, or other kind of ListModelcomp
- associated componentctx
- bind context- Returns:
- the value to save to a bean
-
-