Class CrossFeatures

java.lang.Object
com.dassault_systemes.modeler.kerml.model.CrossFeatures

@OpenApiAll public final class CrossFeatures extends Object
Utility class to work with cross-features.
  • Constructor Details

    • CrossFeatures

      public CrossFeatures()
  • Method Details

    • isAcceptableAsOwnedCrossFeature

      public static boolean isAcceptableAsOwnedCrossFeature(Feature feature)
      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 by FeatureMembership or FeatureValue.
      Parameters:
      owningMembership - the membership to check
      Returns:
      true if acceptable as owning membership of a cross feature
    • createOwnedCrossFeatureFromEnd

      public static void createOwnedCrossFeatureFromEnd(Feature endFeature)
      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

      public static Feature createOwnedCrossFeature(Feature endFeature)
      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 an EndFeatureMembership.
      Parameters:
      endFeature - the end feature
      Returns:
      created cross feature
    • setCrossFeatureOwningEnd

      public static void setCrossFeatureOwningEnd(Feature crossFeature, Feature endFeature)
      Sets the owning membership of the cross feature so that it is owned by the end feature.
      Parameters:
      crossFeature - the cross feature
      endFeature - the end feature
    • moveCrossFeatureToEnd

      public static void moveCrossFeatureToEnd(Feature endFeature)
      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

      public static void moveCrossFeatureToEndType(Feature endFeature)
      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

      public static Feature getOrCreateOwnedCrossFeature(Feature feature)
      Returns the owned cross feature of the given feature, creating one if necessary.
      Parameters:
      feature - the feature
      Returns:
      existing or newly created cross feature