Customizing generated IDL files

This article explains how you can customize the IDL files that are generated by the UML-to-CORBA IDL transform.

Overview

The UML-to-CORBA IDL transform uses JET (Java Emitters Templates) to control the formatting of the IDL files it generates. If you are not happy with the default formatting of these files, you can customize the JET templates.

Learn more about JET in this article.

Changing JET Templates

To make the JET templates visible in your Eclipse workspace, perform these steps:

  1. Click Filters and Customization in the Project Explorer view menu:

  1. In the Filters tab unmark the '.* resources' checkbox
  2. Click OK.

You should now see a project called '.JETEmitters' in the Project Explorer. This project contains a 'templates' folder where you find all JET templates (*.idljet files) that are used for IDL generation. When you update any of these templates, Java code in the 'src' folder is automatically generated and will be used the next time you run the UML-to-CORBA IDL transform.

There is one template file for each IDL construct. In addition there is a file SettingsTemplate.idljet which contains general formatting settings, such as indentation and line length.

Reverting Corrupted JET Templates

If you make a mistake when editing a JET template it's possible that the corresponding Java file will contain errors when you run the UML-to-CORBA IDL transform. Such errors are not explicitly reported when you run the transform. If you have modified a JET template and don't get any result when running the transform, expand the 'src' folder in the '.JETEmitters' project and check for errors. For example:

Don't be tempted to fix the problem in this Java file since it's an automatically generated file. Instead the problem must be fixed in the JET template that you edited.

If you are unable to correct the error in the JET template, you can simply delete the .idljet file. It will be restored with its original contents the next time you run the UML-to-CORBA IDL transform.