Use the UML-to-Java transformations to create a Java™ project
from Unified Modeling Language (UML) specifications and to generate Java code
from a UML model.
Applying UML-to-Java transformation profiles To see a list of potential problems that can occur in the Java code
that the transformation generates, apply the UML-to-Java 1.4 transformation profile
or the UML-to-Java 5.0 transformation profile
to the source UML model. After
you apply the profile, you can run the model validation feature, or run the
transformation. See the Problems view for warnings about
invalid model elements.
Specifying exceptions in UML operations
To represent Java exceptions in a UML model, you can
specify UML classes in the RaisedException property of a UML operation. When
you run the UML-to-Java 5.0 transformation,
the transformation creates a Java method that corresponds to the UML
operation. The method signature contains a throws statement
that contains the class or classes that you specify in the RaisedException
property.
Creating or editing UML-to-Java transformation configurations To generate output such as code from a source model,or to generate a model from code, you
must run a transformation. To run a transformation,
you must create a transformation configuration. A transformation configuration
specifies information that a transformation requires to generate the expected
output.
Running and rerunning UML-to-Java transformations You can run a transformation on an entire UML
model or on a subset of model elements to generate output such as code. When
you rerun the transformation after you change the source model or the generated
code, you must identify the sections of generated code that you do not want
the transformation to overwrite, and then protect them. Rerunning a transformation
involves the same steps as running a transformation for the first time.