The UML metamodel implementation itself does not provide a way to assign stereotypes and tags directly to Elements. The UML metamodel implementation in a modeling tool provides a pretty complex mapping — every UML Element can have an Instance of assigned Stereotypes. It is stored as the Element.appliedStereotypeInstance property. Slots of this instance are TaggedValues. If several stereotypes are applied, same InstanceSpecification is used with many classifiers set.

 

There are two ways to work with profiling information

  • We provide a com.nomagic.uml2.ext.jmi.helpers.StereotypesHelper helper class  for hiding this mapping complexity. It has set of useful methods for assigning or unassigning stereotypes and creating TaggedValues. Keep in mind that TaggedValues in this helper class are called Slots.
  • Use profile implementation classes