A transformation configuration has .tc as a file name extension, and contains the information that the transformation uses to generate the output that you expect. A transformation configuration also contains information that is specific to a particular type of transformation. To edit an existing transformation configuration, in a view that shows the workspace resources, double-click a transformation configuration file, which opens the transformation configuration editor.
To simplify working with the transformation configuration file, save the configuration file in the project that contains the elements to transform.
This option modifies the same transformation property as the Generate getter and setter methods option in the reverse transformation. If you select one of the check boxes, it is equivalent to clearing the other. Clear this check box if you want to generate Java getters and setters when you run the reverse transformation, but you do not want to display the UML operations for Java getters and setters in the target UML model when you run the forward transformation.
If the transformation target is an existing UML model, you should specify the same package structure as the target model; this reduces the number of differences that you must resolve between the target model and the temporary model that the transformation generates.
For example, assume that a source Java project contains the classes a.b.Y and a.b.c.Z. If you select the check box, the transformation generates UML packages a.b and a.b.c. These packages are not hierarchical. UML class Y is created in UML package a.b, and UML class Z is created in UML package a.b.c. If you clear the check box, UML package a is created; UML package b is created in package a; UML package c is created in package b; UML class Z is created in package c; and UML class Y is created in package b.
The log file provides information about the source elements, the target elements, and the rules that the transformation applies to transform the source elements. If the transformation transforms many elements, you might experience decreased performance while the transformation generates the log file; therefore, you should only generate a log file for debugging purposes.
Running a transformation in silent mode suppresses all dialog boxes that the transformation generates. The transformation applies default rules and behavior, which might generate unexpected or incorrect transformation output. You should only run a transformation in silent mode to validate that the transformation runs, instead of validating the transformation output. For example, you might run a transformation in silent mode as part of an automated task or automated test suite.
Setting the transformation to run in silent mode overrides the file-overwrite options that you specify, and overwrites files if necessary.
If the UML-to-Java transformation is available, you can select the Run the reverse transformation silently check box. Specifying that the UML-to-Java, or reverse transformation runs in silent mode overrides the file overwrite options that you specify in the transformation configuration. The UML-to-Java transformation overwrites files if necessary.
You can use trace relationships and the visual development tools to understand the relationships between source model elements and transformation output. This function is useful in large projects that might contain multiple models and transformation configurations. The transformation does not alter the source model.
To generate UML enumerations that preserve the name and values of the enumeration literals, select the com.ibm.xtools.transform.java.enumext.j2u.transform check box. The properties of the custom Java enumeration are preserved when it transforms into UML.
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. 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.
For example, to transform Java vector classes into UML sequences, select java.util.Vector from the Sequence list instead of the 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.
See the related reference topic below for more information about how the transformation populates UML collection properties when it transforms Java collections.
The Java-to-UML transformation uses the mapping models to determine the appropriate name for the UML elements that it generates. For example, a UML model contains PackageA, and PackageA contains Class1. When you create a mapping model for the UML-to-Java transformation, you can specify that Class1 has an alternate file name of MappedClass1. When you run the UML-to-Java transformation, it generates Java files named PackageA.MappedClass1.java. When you run the Java-to-UML transformation, the transformation determines that the original UML path for the Java element is PackageA.Class1, and generates a UML class named Class1 in a UML package named PackageA.
If the artifact file name that you specify in the mapping model is not a valid Java file name, then the transformation modifies the name of the file when it creates the Java code element. For example, if the mapping model specifies an alternate file name of "Mapped Class1", instead of MappedClass1, the transformation generates a Java file named Mapped_Class1.java. The transformation does not keep a record of these modifications; therefore, the Java-to-UML transformation cannot map the Mapped_Class1 file to the original UML element. In this example, the Java-to-UML transformation transforms the Mapped_Class1 Java source object into a UML class named Mapped_Class1, instead of Class1.