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.