java.lang.Object
com.dassault_systemes.modeler.sysml.model.Parts

@OpenApiAll public class Parts extends Object
Utility class providing helper methods for identifying part usages and part definitions, as well as retrieving owned parts from a type.

In SysML, a part may appear either as a PartUsage or a PartDefinition. These helpers make it easy to detect and work with both forms.

  • Constructor Details

    • Parts

      public Parts()
  • Method Details

    • isOwningTypePartUsageOrDefinition

      public static boolean isOwningTypePartUsageOrDefinition(Feature feature)
      Checks whether the owning type of the given feature is a PartUsage or PartDefinition.
      Parameters:
      feature - the feature whose owning type is checked
      Returns:
      true if the owning type is a part usage or definition
    • isPartUsageOrDefinition

      public static boolean isPartUsageOrDefinition(@CheckForNull Element element)
      Checks whether the given element is a PartUsage or PartDefinition.
      Parameters:
      element - the element to check
      Returns:
      true if the element is a part usage or definition
    • getOwnedPart

      public static List<PartUsage> getOwnedPart(Type type)
      Returns the parts owned by the given type. For part definitions, this returns the owned parts; for part usages, this returns the nested parts.
      Parameters:
      type - the type whose parts are requested
      Returns:
      list of owned or nested parts
      Throws:
      IllegalArgumentException - if the type is not a part usage or definition
    • isPurePartUsageOrDefinition

      public static boolean isPurePartUsageOrDefinition(org.eclipse.emf.ecore.EClass eClass)
      Checks whether the given EClass represents a pure part usage or pure part definition. “Pure” means the EClass matches the SysML metaclass exactly.
      Parameters:
      eClass - the class to check
      Returns:
      true if the class is a pure part usage or definition
    • isPurePartDefinition

      public static boolean isPurePartDefinition(org.eclipse.emf.ecore.EClass eClass)
      Checks whether the given EClass represents a pure part definition.
      Parameters:
      eClass - the class to check
      Returns:
      true if pure part definition
    • isPurePartUsage

      public static boolean isPurePartUsage(org.eclipse.emf.ecore.EClass eClass)
      Checks whether the given EClass represents a pure part usage.
      Parameters:
      eClass - the class to check
      Returns:
      true if pure part usage