Class VariantProductModelConverter
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.converter.impl.ItemModelConverter
-
- de.hybris.platform.servicelayer.internal.converter.impl.VariantProductModelConverter
-
- All Implemented Interfaces:
TypeSystemAwareModelConverter
,UpdateableModelConverter
,ModelConverter
,java.lang.Cloneable
public class VariantProductModelConverter extends ItemModelConverter
VariantProduct - specific ModelConverter. It's required for VariantProducts to provide the correct type (via getType). Using the default ItemModelConverter the returned type is recognized as abstract by VariantType, which is used during the save - action.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.converter.impl.ItemModelConverter
ItemModelConverter.AttributesToLoad, ItemModelConverter.LoadedAttributeValues, ItemModelConverter.ModelAttributeInfo, ItemModelConverter.ModifiedAttributeValues, ItemModelConverter.RelationTypeAttributeInfo, ItemModelConverter.TypeAttributeInfo, ItemModelConverter.TypeMetaInfo
-
-
Constructor Summary
Constructors Constructor Description VariantProductModelConverter(ModelService modelService, I18NService i18nService, CommonI18NService commonI18NService, java.lang.String type, java.lang.Class<? extends AbstractItemModel> modelClass, SerializationStrategy serializationStrategy, SourceTransformer sourceTransformer, SelfHealingService selfHealingService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getType(java.lang.Object model)
Returns the exact type of the given model.protected java.lang.String
getTypeFromBaseProduct(VariantProductModel model)
-
Methods inherited from class de.hybris.platform.servicelayer.internal.converter.impl.ItemModelConverter
addModelModificationListener, afterDetach, afterModification, assembleMetaInfo, beforeAttach, calculateTypeAttributeInfos, clearAttribute, clearLocAttribute, convertModelsToObjects, convertObjectsToModels, create, createContextForExistingModel, createContextForNewModel, createModelAttributeInfo, createModelInstance, createNewItem, equals, exists, fillModel, getAllModelAttributes, getAttributesToReload, getAttributeValue, getCommonI18NService, getComposedType, getConfig, getDefaultType, getDirtyAttributes, getDirtyAttributeValue, getDirtyLocalizedAttributesWithNonDataLocales, getDirtyLocalizedAttributeValue, getDynamicAttributesProvider, getExcluded, getFieldValue, getGetter, getI18nService, getInfo, getInitialModelAttributes, getLocaleProvider, getLocalizedAttributeValue, getLocalizedGetter, getLocalizedSetter, getMandatoryAttributes, getMandatoryAttributesForCreation, getModelClass, getModelService, getPartOfAttributes, getPersistenceSource, getSerializationStrategy, getSetter, getSource, getStdLocale, getTypeFromModelContext, getUniqueAttributes, getWritablePartOfAttributes, hashCode, hasNonDataLocales, init, isConfiguredForLegacyPersistence, isEnumValue, isModified, isModified, isModified, isNew, isNonLazyLoadedAttribute, isReferenceAttribute, isRemoved, isUpToDate, jaloOnlyAttribute, load, mergeNonDataLocales, mergeOldValuesIntoDataLocales, mustConvert, preLoadAttribute, preLoadLocAttribute, readAttributes, readPrefetchSettings, readSingleAttribute, reload, remove, removeModelModificationListener, save, setAttributeLoadError, setAttributeValue, setLocAttributeLoadError, storeAttributes, toString, typeSystemChanged, unloadAttributes
-
-
-
-
Constructor Detail
-
VariantProductModelConverter
public VariantProductModelConverter(ModelService modelService, I18NService i18nService, CommonI18NService commonI18NService, java.lang.String type, java.lang.Class<? extends AbstractItemModel> modelClass, SerializationStrategy serializationStrategy, SourceTransformer sourceTransformer, SelfHealingService selfHealingService)
-
-
Method Detail
-
getType
public java.lang.String getType(java.lang.Object model)
Returns the exact type of the given model. This method is overridden because it requires some specific handling for VariantProduct. The returned Type would be typically "VariantProduct" (itemType), which is recognized as abstract in the variantType, which will be used later before persisting the object. In such case - ModelServiceException is thrown. The proper solution for VariantProduct is to return variant type of the base product type.- Specified by:
getType
in interfaceModelConverter
- Overrides:
getType
in classItemModelConverter
-
getTypeFromBaseProduct
protected java.lang.String getTypeFromBaseProduct(VariantProductModel model)
-
-