Class Parts
java.lang.Object
com.dassault_systemes.modeler.sysml.model.Parts
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetOwnedPart(Type type) Returns the parts owned by the given type.static booleanisOwningTypePartUsageOrDefinition(Feature feature) Checks whether the owning type of the given feature is aPartUsageorPartDefinition.static booleanisPartUsageOrDefinition(Element element) Checks whether the given element is aPartUsageorPartDefinition.static booleanisPurePartDefinition(org.eclipse.emf.ecore.EClass eClass) Checks whether the given EClass represents a pure part definition.static booleanisPurePartUsage(org.eclipse.emf.ecore.EClass eClass) Checks whether the given EClass represents a pure part usage.static booleanisPurePartUsageOrDefinition(org.eclipse.emf.ecore.EClass eClass) Checks whether the given EClass represents a pure part usage or pure part definition.
-
Constructor Details
-
Parts
public Parts()
-
-
Method Details
-
isOwningTypePartUsageOrDefinition
Checks whether the owning type of the given feature is aPartUsageorPartDefinition.- Parameters:
feature- the feature whose owning type is checked- Returns:
- true if the owning type is a part usage or definition
-
isPartUsageOrDefinition
Checks whether the given element is aPartUsageorPartDefinition.- Parameters:
element- the element to check- Returns:
- true if the element is a part usage or definition
-
getOwnedPart
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
-