Getting Parts of a capsule (some type casting issue) [message #1744865] |
Fri, 30 September 2016 21:38  |
Eclipse User |
|
|
|
Hi,
I need to get Parts of a Capsule object (which is of type Class). I am basically working with org.eclipse.uml2.uml objects. Here is my code:
public static List<Property> getCapsuleParts(Class capsule){
for (Property part: capsule.getParts()){
// I want part object being of type Class rather than Property.
}
}
What I need is to have part object being of type Class rather than Property. Of course each part is a property, but there must be a way to cast (or convert) a Property object to a Class one.
I am working on a Papyrus-RT plugin, but I think this is not Papyrus-RT related though.
Any idea is appreciated.
|
|
|
Re: Getting Parts of a capsule (some type casting issue) [message #1744866 is a reply to message #1744865] |
Fri, 30 September 2016 21:47   |
Eclipse User |
|
|
|
Hi,
A property has a type and that type may be a class. If it is a class, then the CapsuleUtils::isCapsule API can tell you whether that class is a capsule. If so, then the property is a capsule-part. Otherwise, it may be an attribute of primitive or passive class type, or even a port.
HTH,
Christian
|
|
|
|
Powered by
FUDForum. Page generated in 0.04472 seconds