Skip to content

Commit

Permalink
Add 'skip' copy type to ERXCopyable to enable ignoring of attributes,…
Browse files Browse the repository at this point in the history
… mostly to keep values that are applied during EO initialization.
  • Loading branch information
fbarthez authored and darkv committed May 30, 2016
1 parent 301d97a commit 8a20eaa
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,13 @@ public interface ERXCopyable<T extends ERXCopyable<T>> extends ERXEnterpriseObje
* @author David Avendasora
*/
public enum CopyType {

/**
* Stored as " {@code ERXCopyable.CopyType = Skip;}" in the
* property's UserInfo dictionary. Skips the value.
* <em>For attributes only.</em>
*/
SKIP("Skip", new NSArray<Class<? extends EOProperty>>(EOAttribute.class, EORelationship.class)),

/**
* Stored as " {@code ERXCopyable.CopyType = Nullify;}" in the
Expand Down Expand Up @@ -1334,6 +1341,9 @@ public static <T extends ERXCopyable<T>> void modelCopyAttribute(T source, T des
case NULLIFY:
destination.takeStoredValueForKey(null, attributeName);
break;
case SKIP:
// nothig to do
break;
default:
handleMissingOrInvalidCopyType(attribute, copyType);
}
Expand Down

0 comments on commit 8a20eaa

Please sign in to comment.