Class CrossFeatures
java.lang.Object
com.dassault_systemes.modeler.kerml.model.CrossFeatures
Utility class to work with cross-features.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic FeaturecreateOwnedCrossFeature(Feature endFeature) Creates a new owned cross feature for the given end feature.static voidcreateOwnedCrossFeatureFromEnd(Feature endFeature) Creates an owned cross feature from the given end feature and copies relevant properties such as ordering, uniqueness, and multiplicity.static FeaturegetOrCreateOwnedCrossFeature(Feature feature) Returns the owned cross feature of the given feature, creating one if necessary.static booleanisAcceptableAsOwnedCrossFeature(Feature feature) Checks whether the given feature is acceptable as an owned cross feature.static booleanisAcceptableAsOwningMembershipOfOwnedCrossFeature(OwningMembership owningMembership) Checks whether the given owning membership is acceptable for an owned cross feature.static voidmoveCrossFeatureToEnd(Feature endFeature) Moves the cross feature associated with the given end feature so that it becomes owned by the end feature.static voidmoveCrossFeatureToEndType(Feature endFeature) Moves the cross feature associated with the given end feature so that it becomes owned by the type of the opposite end.static voidsetCrossFeatureOwningEnd(Feature crossFeature, Feature endFeature) Sets the owning membership of the cross feature so that it is owned by the end feature.
-
Constructor Details
-
CrossFeatures
public CrossFeatures()
-
-
Method Details
-
isAcceptableAsOwnedCrossFeature
Checks whether the given feature is acceptable as an owned cross feature. Cross features cannot be multiplicities, binding connectors, or metadata features.- Parameters:
feature- the feature to check- Returns:
- true if the feature can be used as an owned cross feature
-
isAcceptableAsOwningMembershipOfOwnedCrossFeature
public static boolean isAcceptableAsOwningMembershipOfOwnedCrossFeature(@CheckForNull OwningMembership owningMembership) Checks whether the given owning membership is acceptable for an owned cross feature. Cross features cannot be owned byFeatureMembershiporFeatureValue.- Parameters:
owningMembership- the membership to check- Returns:
- true if acceptable as owning membership of a cross feature
-
createOwnedCrossFeatureFromEnd
Creates an owned cross feature from the given end feature and copies relevant properties such as ordering, uniqueness, and multiplicity. The end feature is updated to reflect cross‑feature semantics.- Parameters:
endFeature- the end feature
-
createOwnedCrossFeature
Creates a new owned cross feature for the given end feature. The EClass of the cross feature depends on whether the end feature belongs to anEndFeatureMembership.- Parameters:
endFeature- the end feature- Returns:
- created cross feature
-
setCrossFeatureOwningEnd
Sets the owning membership of the cross feature so that it is owned by the end feature.- Parameters:
crossFeature- the cross featureendFeature- the end feature
-
moveCrossFeatureToEnd
Moves the cross feature associated with the given end feature so that it becomes owned by the end feature. The existing cross feature is converted to a new instance.- Parameters:
endFeature- the end feature
-
moveCrossFeatureToEndType
Moves the cross feature associated with the given end feature so that it becomes owned by the type of the opposite end. The cross feature is reused rather than recreated.- Parameters:
endFeature- the end feature
-
getOrCreateOwnedCrossFeature
Returns the owned cross feature of the given feature, creating one if necessary.- Parameters:
feature- the feature- Returns:
- existing or newly created cross feature
-