Interface ModelCloningContext

All Known Implementing Classes:
CMSModelCloningContext, DefaultAsModelCloningContext, DefaultModelCloningContext, ProductCloneStrategy.ProductModelCloningContext

public interface ModelCloningContext
Allows customization of cloning process.
  • Method Details

    • skipAttribute

      boolean skipAttribute(Object original, String qualifier)
      If true that particular attribute will not be included in the cloning process. As a result the cloned model will not have any value for that attribute.
    • treatAsPartOf

      boolean treatAsPartOf(Object original, String qualifier)
      If true that 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!

    • usePresetValue

      boolean usePresetValue(Object original, String qualifier)
      If true for the given attribute the cloning process will not use the original model attribute values but the one returned by getPresetValue(Object, String).
      See Also:
    • getPresetValue

      Object getPresetValue(Object original, String qualifier)
      Only valid if usePresetValue(Object, String) returns true for the specified attribute.

      Returns the value to be used as attribute value of the new cloned model.