Generating Java Files

You generate Java source files from the classes and interfaces of a model. A separate file, with the file extension .java, is generated for each class or interface that you select from the model. A generation log file is also created at the same time. You can only generate Java files from one model at a time.

A Java source can contain several classes, whereas a Java .class can contain only one class. You can compile the .java class files that you generate from an OOM in any Java compiler tool and run your Java application.

  1. Select Language > Generate Java Code to display the Java generation dialog box.
  2. Type a destination directory for the generated file in the Directory box.

    or

    Click the Select a Path button to the right of the Directory box and browse to select a directory path.

  3. Click the Selection tab, then select the objects to include in the generation from the tabbed pages at the bottom of the page.
    Note:

    All classes of the model, including those grouped into packages, are selected and displayed by default. You use the Select tools to the right of the Folder Selection list to modify the selection. The Include Sub-Packages tool allows you to include all classes located within packages.

  4. Click the Options tab to display the Options page.
  5. <optional> Select the Check Model check box if you want to verify the validity of your model before generation.
  6. Select a value for each required option.
  7. Click the Tasks tab, then select the required task(s).
  8. Click OK to generate.

    A Progress box is displayed. The Result list displays the files that you can edit. The result is also displayed in the Generation page of the Output window, located in the bottom part of the main window.

    All Java files are generated in the destination directory.


Created October 7, 2009. Send feedback on this help topic to Sybase Technical Publications: pubs@sybase.com