Specifying the UML collection types that the Java-to-UML transformation generates

You can specify how the transformation transforms the selected Java™ collection types in the source Java project into UML collection types. A collection represents a group of model elements. The collection type determines whether duplicate model elements in the collection can exist or whether the model elements are ordered.

For each Java collection type in the source project, you can specify the UML collection type that the transformation generates. You can map one Java collection type to one UML collection type. The default selections map the Java Collection, SortedSet, List, and Set classes to the UML Bag, OrderedSet, Sequence, and Set collection types. If your source Java project contains other Java collection types that do not appear on this page, the transformation generates adaptable references to those Java classes in the UML model. The transformation sets the multiplicity properties in the target UML element to false.

For example, for the transformation to transform Java Vector classes into UML Sequences, select java.util.Vector from the Sequence list instead of Java List classes. For each Java List class in the source Java project, the transformation generates an adaptable reference in the target UML model and sets the Is Ordered and Is Unique properties of the generated UML element to false. In this example, the transformation sets these properties to false because it does not transform the Java List collection type into a UML collection type.

To specify the UML collection types that the transformation generates:

  1. In the Project Explorer view, right-click a transformation configuration file; then click Open.
  2. Click the Collections tab.
  3. On the Collections page, from each UML collection type list, select a Java collection type. To specify a custom value, type the value in the appropriate collection field.
  4. Click File > Save.
The options are applied the next time that you run the transformation.
Note: If you create a new transformation configuration, you can specify this information on the Collections page of the New Transformation Configuration wizard.

Feedback