| Properties of the Java class | Transformation output |
|---|---|
| Package | Class in a package with the same name as the Java package |
| Name | Class with the same name |
| Visibility | Same visibility as the source Java class |
| Specifies the final keyword | Is Leaf property is set to true |
| Specifies the abstract keyword | Is Abstract property is set to true |
| Extends a superclass | Generalization relationship between the class and the superclass |
| Implements an interface | Interface realization relationship between the class and the interface |
| Static import (J2SE 5.0) | Usage relationship between the class and the imported element |
| Properties of the Java interface | Transformation output |
|---|---|
| Package | Interface in a package with the same name as the Java package |
| Name | Interface with the same name |
| Visibility | Same visibility as the source Java interface |
| Specifies the abstract keyword | Is Abstract property is set to true |
| Extends a superinterface | Generalization relationship between the interface and the superinterface |
| Static import (J2SE 5.0) | Usage relationship between the interface and the imported element |
| Properties of the Java enumeration | Transformation output |
|---|---|
| Package | Enumeration in a package with the same name as the Java package |
| Name | Enumeration with the same name |
| Visibility | Same visibility as the source Java enumeration |
| Specifies the final keyword | Is Leaf property is set to true |
| Specifies the abstract keyword | Is Abstract property is set to true |
| Static import (J2SE 5.0) | Usage relationship between the interface and the imported element |
| Properties of the Java attribute | Transformation output |
|---|---|
| Name | Property with the same name |
| Visibility | Same visibility as the source Java property |
| Specifies the static keyword | Is Static property is set to true |
| Specifies the final keyword | Is Leaf property is set to true |
| Specifies the abstract keyword | Is Abstract property is set to true |
| Type (non-collection types) | Type property is set to an existing primitive type, a UML element in the model, or a reference to the Java type |
| Type (collection types) | Type property is null; the transformation sets the properties of the «JavaArray» or «JavaCollection» stereotype if it can identify that the code contains a collection or array, and its type |
| Generic type (J2SE 5.0) | Type property is set to the type in the Java class or interface; the transformation sets the properties of the «JavaArray» or «JavaCollection» stereotype if it can identify that the code contains a collection or array, and its type |
The transformation transforms a Java property in an enumeration into a UML enumeration literal that has the same name.
The following table lists how the transformation transforms Java methods in classes and interfaces into UML operations:
| Properties of the Java method | Properties of the UML operation |
|---|---|
| Name | Operation with the same name |
| Visibility | Same visibility as the source Java method |
| Specifies the static keyword | Is Static property is set to true |
| Specifies the final keyword | Is Leaf property is set to true |
| Parameters | Parameter with same properties as the Java parameter;
the transformation generates the parameters in the same order as they appear
in the Java method If the Java method contains a return parameter, the transformation generates the return parameter of the operation before it generates the other parameters for the operation. See the Java method parameters table. |
| Specifies a throws statement and one or more throwable objects | RaisedException property of the UML operation specifies
the exception classes in the throws statement Tip: To
view the properties of the UML operation, in the Project Explorer view, right-click
the UML operation; then click UML Properties.
|
| Properties of the Java method parameter | Properties of the UML parameter |
|---|---|
| Name | Parameter with the same name |
| Type (non-collection types) | Type property is set to an existing primitive type, a UML element in the model, or a reference to the Java type |
| Type (collection types) | Type property is set to null; the transformation sets the properties of the «JavaArray» or «JavaCollection» stereotype if it can identify that the code contains a collection or array, and its type |
| Generic type (J2SE 5.0) | Type property set to the type in the Java class or interface; the transformation sets the properties of the «JavaArray» or «JavaCollection» stereotype if it can identify that the code contains a collection or array, and its type |
/** *<!-- begin-UML-doc --> * This documentation is copied into the UML documentation property for the corresponding UML element. *<!-- end-UML-doc --> */
When you run the transformation, if it can identify Java collections or arrays in the code, and identify the type of the collections or arrays, the transformation applies the «JavaCollection» or the «JavaArray» stereotype to the generated UML element and populates the values of the stereotype properties. Otherwise, the transformation generates an adaptable reference and does not apply a stereotype to the generated UML element.
| Java type | Generated UML type | Is Ordered property | Is Unique property | collectionType property |
|---|---|---|---|---|
| java.util.Collection | Bag: An unordered collection that allows duplicate elements | false | false | java.util.Collection |
| java.util.List | Sequence: An ordered collection that allows duplicate elements | true | false | java.util.List |
| java.util.Set | Set: An unordered collection that does not allow duplicate elements | false | true | java.util.Set |
| java.util.SortedSet | Ordered set: An ordered collection that does not allow duplicate elements | true | true | java.util.SortedSet |