Class CMSModelCloningContext

  • All Implemented Interfaces:
    ModelCloningContext

    public class CMSModelCloningContext
    extends java.lang.Object
    implements 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 Detail

      • CMSModelCloningContext

        public CMSModelCloningContext()
    • Method Detail

      • treatAsPartOf

        public boolean treatAsPartOf​(java.lang.Object component,
                                     java.lang.String qualifier)
        Description copied from interface: ModelCloningContext
        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!

        Specified by:
        treatAsPartOf in interface ModelCloningContext
      • skipAttribute

        public boolean skipAttribute​(java.lang.Object component,
                                     java.lang.String qualifier)
        Description copied from interface: ModelCloningContext
        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.
        Specified by:
        skipAttribute in interface ModelCloningContext
      • addPresetValuePredicate

        public void addPresetValuePredicate​(java.util.function.BiPredicate<ItemModel,​java.lang.String> predicate)
      • getTreatAsPartOfPredicates

        protected java.util.List<java.util.function.BiPredicate<ItemModel,​java.lang.String>> getTreatAsPartOfPredicates()
      • setTreatAsPartOfPredicates

        public void setTreatAsPartOfPredicates​(java.util.List<java.util.function.BiPredicate<ItemModel,​java.lang.String>> treatAsPartOfPredicates)
      • getPresetValuePredicates

        protected java.util.List<java.util.function.BiPredicate<ItemModel,​java.lang.String>> getPresetValuePredicates()
      • setPresetValuePredicates

        public void setPresetValuePredicates​(java.util.List<java.util.function.BiPredicate<ItemModel,​java.lang.String>> presetValuePredicates)