Specifying sources and targets for UML-to-Java transformations

You can select the source model or model elements on which to run a transformation, and specify a location where the transformation generates target elements or files.
The UML-to-Java 1.4 and the UML-to-Java 5.0 transformations generate Java™ classes from the following UML sources:
  • UML models
  • Packages and their contents
  • Non-nested classes and their contents
  • Non-nested interfaces and their contents
  • Enumerations

You can select other elements, but they will not be transformed.

Note: If you enable the reverse transformation, you must specify a model as the transformation source. The reverse transformation transforms Java source objects into UML objects and stores these objects in the UML model that you specify.

You can specify a Java project as the destination for the output of the UML-to-Java 1.4 transformation.

You can specify a Java project, or a source folder in a Java project, as the destination for the output of the UML-to-Java 5.0 transformation.

To specify the source and target of a transformation:

  1. In the Project Explorer view, right-click a transformation configuration file; then click Open.
  2. Click the Source and Target tab.
  3. In the Selected source pane, select a valid source model or model elements for the transformation.
    Note: A model element that is contained by another model element, such as a component or collaboration, is not transformed unless you select it.
  4. In the Selected target pane, select a valid target location for the artifacts that the transformation generates.
    Note: To create a new target location, click Create New Target Container and complete the pages in the wizard.
  5. 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 Source and Target page of the New Transformation Configuration wizard.
Related concepts
UML-to-Java transformations
Related reference
Interpretation of UML elements by UML-to-Java transformations

Feedback