Manually tagging XDE Java code elements

When you run the XDE Java Project Import wizard, the code elements in the Java™ source files are tagged as @generated if an equivalent UML element existed in the corresponding XDE™ Java code model and the synchronization policy for the UML element was set to Synchronize, Accept code changes, or Accept model changes.

After migration, when you use the UML-to-Java transformation capabilities of the Rational® UML modeling product, the code elements that were not tagged during migration are not modified based on changes made in the UML source model.

For example, if you delete or rename a UML class and a Java class exists with the same (fully qualified) name, but without an @generated tag, when you run a UML-to-Java transformation against that UML model, the Java class is not modified in the Java source file. However, you can manually change this behavior.

To manually change the XDE Java code element tagging behavior:

Add an @generated annotation to the element in the source file. This tag tells the UML-to-Java transformation that it now has jurisdiction over the Java element; changes made to the UML model are applied to the Java class in the source code. For more details, see the online help for the UML-to-Java transformation.

Note: During migration, the XDE Java Project Import wizard searches for the @modelguid annotations that were placed into the Java code by the XDE code-model synchronization feature. The wizard replaces them with @generated annotations based on the rule described above. As a part of the migration, all the XDE-generated @modelguid annotations are removed from the migrated code.
Related concepts
Migration of Rational XDE Java projects and code models
Related reference
Collection classes and arrays in XDE Java code model import

Feedback