|
|
|
Re: How to get "tagged values" from an attribute of class in UML2.0 [message #1064307 is a reply to message #1064213] |
Tue, 18 June 2013 15:26 |
Rafael Chaves Messages: 161 Registered: July 2009 |
Senior Member |
|
|
A stereotype application connects a stereotype to an element (and instance of the stereotype) and describes the values of the stereotype attributes in that instance. Tagged values are no longer supported in UML, and were replaced by stereotype attributes.
You query the values of the stereotype attributes in a particular stereotype application using Element#getValue(Stereotype, String attributeName). You determine whih stereotypes apply to an element using Element#getAppliedStereotypes(). You find out what attributes are available on the Stereotype using Stereotype#getOwnedAttributes(). You can also use UMLUtil.getTaggedValue(String stereotypeName, String attributeName) to get one particular value. There is a wealth of stereotype-related API in Element, Stereotype and UMLUtil, get familiar with them.
If #getAppliedStereotypes() returns an empty list and you are positive there are stereotypes applied to the element in question, you may be suffering of an unresolved profile reference in the model. Does yourPackage.getAppliedProfiles() return an empty list as well? Can you paste your model here?
[Updated on: Tue, 18 June 2013 15:29] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03123 seconds