< Previous | Next >

Lesson 2: Examine the mapping project

After you create the mapping project, you can use the Package Explorer view to examine the structure of the project.

To examine the contents of the mapping project:

  1. In the Package Explorer view, expand the Generalize Classes mapping project and observe the generated files.
  2. Navigate to the model folder. Notice how this folder contains a mapping model that has the same name as the transformation mapping project; the file also has .mapping as a file name extension. A mapping project can contain multiple mapping models. Later in this tutorial you add mapping declarations to this mapping model.

    Mapping models, also called mapping files, are instances of Eclipse Modeling Framework (EMF) metamodels, also called Ecore models, that contain references to the metamodels that are being mapped. When you create a mapping project, the authoring tools create a mapping model in the project by using the input and output model or models that you specify. A mapping model has .mapping as a file name extension.

    Mapping models are stored and serialized as XML files. The Problems view displays detailed error information about mapping models. In this view, double-click an item to open the mapping model in a text editor and view the line that contains the error. This method of troubleshooting is often easier than troubleshooting by viewing the mapping model in the editor area.

  3. In the Package Explorer view, expand the src folder. The generalize_classes.transforms folder contains the source code for the generated transforms. At this point, only one default transform exists, called MainTransform. Later in this tutorial, you create mapping declarations and regenerate the transformation source code. For each mapping declaration in the mapping model, the transformation authoring framework generates a Java class with the name nTransform, where n represents the name of the mapping declaration. Collectively, these Java classes compose the transformation code.
  4. In the Package Explorer view, in the model folder, double-click the mapping model. The transformation mapping editor opens, which enables you to create mapping declarations and refine the mapping rules in each mapping declaration. You complete these tasks in the following lessons in this module.
< Previous | Next >

Feedback