Package com._1c.g5.v8.dt.ui.aef.mappers
Class AefLabelMapper<M,T extends ItemViewModel>
java.lang.Object
com._1c.g5.v8.dt.ui.aef.mappers.AefLabelMapper<M,T>
- All Implemented Interfaces:
IMapper<M,,T> IViewModelsMapper<M,T>
- Direct Known Subclasses:
AefLabelCheckStateMapper,CharacteristicsTableMapper,PredefinedDataComponent.PredefinedDataMapper
public class AefLabelMapper<M,T extends ItemViewModel>
extends Object
implements IViewModelsMapper<M,T>
IMapper implementation that maps model object with the view structure specific.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAefLabelMapper(ILabelProvider labelProvider) Creates a new mapper.AefLabelMapper(ILabelProvider labelProvider, boolean needDecorate) Creates a new mapper. -
Method Summary
Modifier and TypeMethodDescriptionprotected TCreates a view model item.protected ObjectcreateMapKey(M modelValue) Creates a map key object.protected TcreateModelToView(M modelValue) Creates and updates a view model item.Returns the mapped models collection, nevernullReturn the mapped viewModels.mapModelToView(M modelValue) Maps the model value to some projected view value.mapViewToModel(T viewValue) Maps the view value to associated model value.voidupdateItemViewModel(T item, M modelValue) Updates item view model.
-
Field Details
-
labelProvider
-
-
Constructor Details
-
AefLabelMapper
Creates a new mapper.- Parameters:
labelProvider- the label provider for mapping labels of domain model object to view model, cannot benull
-
AefLabelMapper
Creates a new mapper.- Parameters:
labelProvider- the label provider for mapping labels of domain model object to view model, cannot benullneedDecorate-trueif need to wrappILabelProvidertoDecoratingLabelProvider,falseotherwise
-
-
Method Details
-
mapModelToView
Description copied from interface:IMapperMaps the model value to some projected view value.- Specified by:
mapModelToViewin interfaceIMapper<M,T extends ItemViewModel> - Parameters:
modelValue- the model value to map.- Returns:
- mapped value.
-
mapViewToModel
Description copied from interface:IMapperMaps the view value to associated model value.- Specified by:
mapViewToModelin interfaceIMapper<M,T extends ItemViewModel> - Parameters:
viewValue- the view value to map.- Returns:
- mapped value.
-
getMappedViewModels
Description copied from interface:IViewModelsMapperReturn the mapped viewModels.- Specified by:
getMappedViewModelsin interfaceIViewModelsMapper<M,T extends ItemViewModel> - Returns:
- the mapped viewModels, cannot be
null
-
getMappedModels
Description copied from interface:IViewModelsMapperReturns the mapped models collection, nevernull- Specified by:
getMappedModelsin interfaceIViewModelsMapper<M,T extends ItemViewModel> - Returns:
- the mapped models collection, never
null
-
updateItemViewModel
Description copied from interface:IViewModelsMapperUpdates item view model.- Specified by:
updateItemViewModelin interfaceIViewModelsMapper<M,T extends ItemViewModel> - Parameters:
item- the item view model, cannot benullmodelValue- modelValue the model value, cannot benull
-
createMapKey
Creates a map key object. Override to implement specific mappings.- Parameters:
modelValue- the model value, cannot benull- Returns:
- the key for 'modelValue-to-viewValue' map, cannot be
null
-
createModelToView
Creates and updates a view model item.- Parameters:
modelValue- the model value, cannot benull- Returns:
- the newly created view model, cannot be
null
-
createItemViewModel
Creates a view model item.- Parameters:
modelValue- the model value, cannot benull- Returns:
- the newly created view model, cannot be
null
-