public class CMSModelCloningContext extends java.lang.Object implements ModelCloningContext
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 and Description |
|---|
CMSModelCloningContext() |
| Modifier and Type | Method and Description |
|---|---|
void |
addPresetValuePredicate(java.util.function.BiPredicate<ItemModel,java.lang.String> predicate) |
java.lang.Object |
getPresetValue(java.lang.Object component,
java.lang.String qualifier)
Only valid if
ModelCloningContext.usePresetValue(Object, String) returns true for the specified attribute. |
protected java.util.List<java.util.function.BiPredicate<ItemModel,java.lang.String>> |
getPresetValuePredicates() |
protected java.util.List<java.util.function.BiPredicate<ItemModel,java.lang.String>> |
getTreatAsPartOfPredicates() |
void |
setPresetValuePredicates(java.util.List<java.util.function.BiPredicate<ItemModel,java.lang.String>> presetValuePredicates) |
void |
setTreatAsPartOfPredicates(java.util.List<java.util.function.BiPredicate<ItemModel,java.lang.String>> treatAsPartOfPredicates) |
boolean |
skipAttribute(java.lang.Object component,
java.lang.String qualifier)
If
true that particular attribute will not be included in the cloning process. |
boolean |
treatAsPartOf(java.lang.Object component,
java.lang.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. |
boolean |
usePresetValue(java.lang.Object component,
java.lang.String qualifier)
If
true for the given attribute the cloning process will not use the original model attribute values
but the one returned by ModelCloningContext.getPresetValue(Object, String). |
public boolean treatAsPartOf(java.lang.Object component,
java.lang.String qualifier)
ModelCloningContexttrue 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!treatAsPartOf in interface ModelCloningContextpublic boolean skipAttribute(java.lang.Object component,
java.lang.String qualifier)
ModelCloningContexttrue 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.skipAttribute in interface ModelCloningContextpublic boolean usePresetValue(java.lang.Object component,
java.lang.String qualifier)
ModelCloningContexttrue for the given attribute the cloning process will not use the original model attribute values
but the one returned by ModelCloningContext.getPresetValue(Object, String).usePresetValue in interface ModelCloningContextModelCloningContext.getPresetValue(Object, String)public java.lang.Object getPresetValue(java.lang.Object component,
java.lang.String qualifier)
ModelCloningContextModelCloningContext.usePresetValue(Object, String) returns true for the specified attribute.
Returns the value to be used as attribute value of the new cloned model.getPresetValue in interface ModelCloningContextpublic void addPresetValuePredicate(java.util.function.BiPredicate<ItemModel,java.lang.String> predicate)
protected java.util.List<java.util.function.BiPredicate<ItemModel,java.lang.String>> getTreatAsPartOfPredicates()
public void setTreatAsPartOfPredicates(java.util.List<java.util.function.BiPredicate<ItemModel,java.lang.String>> treatAsPartOfPredicates)
protected java.util.List<java.util.function.BiPredicate<ItemModel,java.lang.String>> getPresetValuePredicates()
public void setPresetValuePredicates(java.util.List<java.util.function.BiPredicate<ItemModel,java.lang.String>> presetValuePredicates)
Copyright © 2018 SAP SE. All Rights Reserved.