Package org.zkoss.bind.converter.sys
Class AbstractListModelConverter<C extends org.zkoss.zk.ui.Component>
java.lang.Object
org.zkoss.bind.converter.sys.AbstractListModelConverter<C>
- All Implemented Interfaces:
Serializable,Converter<Object,Object, C>
- Direct Known Subclasses:
ComboboxModelConverter,GridModelConverter,ListboxModelConverter,RadiogroupModelConverter,SelectboxModelConverter,TabboxModelConverter
public abstract class AbstractListModelConverter<C extends org.zkoss.zk.ui.Component>
extends Object
implements Converter<Object,Object,C>, Serializable
The abstract
Converter implementation for converting collection to ListModel and vice versa.- Since:
- 6.0.0
- Author:
- dennis
- See Also:
-
Field Summary
Fields inherited from interface org.zkoss.bind.Converter
IGNORED_VALUE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncoerceToBean(Object val, C comp, BindContext ctx) Convert aListModelto Set, Map, List, or ListModel (itself).coerceToUi(Object val, C comp, BindContext ctx) Convert a Set, Map, List, Object[], Enum, or other kind of ListModel to associatedListModel.protected abstract org.zkoss.zul.ListModel<?>getComponentModel(C comp) protected org.zkoss.zul.ListModel<?>handleWrappedModel(BindContext ctx, C comp, org.zkoss.zul.ListModel<?> model) post processing the wrapped model. default return original one
-
Constructor Details
-
AbstractListModelConverter
public AbstractListModelConverter()
-
-
Method Details
-
getComponentModel
- Parameters:
comp- the component that has listmodel- Returns:
- null if no list model for the component
-
handleWrappedModel
protected org.zkoss.zul.ListModel<?> handleWrappedModel(BindContext ctx, C comp, org.zkoss.zul.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
Convert a Set, Map, List, Object[], Enum, or other kind of ListModel to associatedListModel.- Specified by:
coerceToUiin interfaceConverter<Object,Object, C extends org.zkoss.zk.ui.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
Convert aListModelto Set, Map, List, or ListModel (itself).- Specified by:
coerceToBeanin interfaceConverter<Object,Object, C extends org.zkoss.zk.ui.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
-