Class CMSModelCloningContext
java.lang.Object
de.hybris.platform.cms2.cloning.service.impl.CMSModelCloningContext
- All Implemented Interfaces:
ModelCloningContext
Defines the
ModelCloningContext to use for deep cloning components that are supported by SmartEdit. The
cloning context specifies if a given attribute should be treated as partOf, should be skipped or should use a
preset value.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPresetValuePredicate(AttributePresetHandler presetValueHandler) Allows to addAttributePresetHandlerdirectly to the list of presetValueHandlers.getPresetValue(Object component, String qualifier) Only valid ifModelCloningContext.usePresetValue(Object, String)returnstruefor the specified attribute.protected List<AttributePresetHandler<Object>>protected List<BiPredicate<ItemModel,String>> Deprecated, for removal: This API element is subject to removal in a future version.protected List<BiPredicate<ItemModel,String>> voidsetPresetValueHandlers(List<AttributePresetHandler<Object>> presetValueHandlers) voidsetPresetValuePredicates(List<BiPredicate<ItemModel, String>> presetValuePredicates) Deprecated, for removal: This API element is subject to removal in a future version.since 2105, please usegetPresetValueHandlers()instead.voidsetTreatAsPartOfPredicates(List<BiPredicate<ItemModel, String>> treatAsPartOfPredicates) booleanskipAttribute(Object component, String qualifier) Iftruethat particular attribute will not be included in the cloning process.booleantreatAsPartOf(Object component, String qualifier) Iftruethat particular attribute is treated as partOf which results in deep-cloning each attribute value too before assigning them as value to the cloned model.booleanusePresetValue(Object component, String qualifier) Iftruefor the given attribute the cloning process will not use the original model attribute values but the one returned byModelCloningContext.getPresetValue(Object, String).
-
Constructor Details
-
CMSModelCloningContext
public CMSModelCloningContext()
-
-
Method Details
-
treatAsPartOf
Description copied from interface:ModelCloningContextIftruethat particular attribute is treated as partOf which results in deep-cloning each attribute value too before assigning them as value to the cloned model.This applies to model reference attributes only!
- Specified by:
treatAsPartOfin interfaceModelCloningContext
-
skipAttribute
Description copied from interface:ModelCloningContextIftruethat particular attribute will not be included in the cloning process. As a result the cloned model will not have any value for that attribute.- Specified by:
skipAttributein interfaceModelCloningContext
-
usePresetValue
Description copied from interface:ModelCloningContextIftruefor the given attribute the cloning process will not use the original model attribute values but the one returned byModelCloningContext.getPresetValue(Object, String).- Specified by:
usePresetValuein interfaceModelCloningContext- See Also:
-
getPresetValue
Description copied from interface:ModelCloningContextOnly valid ifModelCloningContext.usePresetValue(Object, String)returnstruefor the specified attribute.Returns the value to be used as attribute value of the new cloned model.
- Specified by:
getPresetValuein interfaceModelCloningContext
-
addPresetValuePredicate
Allows to addAttributePresetHandlerdirectly to the list of presetValueHandlers.- Parameters:
presetValueHandler- the newAttributePresetHandlerhandler.
-
getTreatAsPartOfPredicates
-
setTreatAsPartOfPredicates
-
getPresetValuePredicates
@Deprecated(since="2105", forRemoval=true) protected List<BiPredicate<ItemModel,String>> getPresetValuePredicates()Deprecated, for removal: This API element is subject to removal in a future version.since 2105, please usegetPresetValueHandlers()instead. -
setPresetValuePredicates
@Deprecated(since="2105", forRemoval=true) public void setPresetValuePredicates(List<BiPredicate<ItemModel, String>> presetValuePredicates) Deprecated, for removal: This API element is subject to removal in a future version.since 2105, please usegetPresetValueHandlers()instead. -
getPresetValueHandlers
-
setPresetValueHandlers
-
getPresetValueHandlers()instead.