The XDE Java Project Import wizard converts attributes, associations, and operation parameters in the imported model that are implemented as collections and arrays to the appropriate representation. The imported model can then be used with the UML-to-Java 5 and Java-to-UML transformations to keep the link between the model and the code.
In Rational XDE, the Java RTE profile for XDE code models defines tagged values to represent JavaDimensions and JavaCollection tagged values. These values specify whether the type of element is an array or collection; they determine how Rational XDE for Java generates code for attributes, associations, and parameters. The UML modeling products represent the concept of collections in the UML domain differently. When an attribute, association, or parameter has multiplicity greater than 1, two extra properties are applied in UML: IsOrdered and IsUnique.
The following table lists how the UML-to-Java transformations process parameters, attributes and associations by default. When you create or configure a UML-to-Java transformation configuration, you can specify that the transformation generate a different Java collection type. For example, when both UML properties are true, the UML Collection type is Ordered set and the generated Java type after the transformation is java.util.SortedSet.
UML properties and corresponding collection types
| IsOrdered UML property | IsUnique UML property | UML collection | Generated Java type |
|---|---|---|---|
true |
true |
Ordered set |
java.util.SortedSet |
true |
false |
Sequence |
java.util.List |
false |
true |
Set |
java.util.Set |
false |
false |
Bag |
java.util.Collection |