Chapter 14 Working with Java
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.
To generate Java files:
- Select Language→Generate Java Code to display the Java generation dialog box.
- 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.
- Click the Selection tab to display the Selection page.
- Select the objects to include in the generation from the tabbed pages at the bottom of the page.
Select Tools
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 dropdown listbox to modify the selection. The Include Sub-Packages tool allows you to include all classes located within packages.
- Click the Options tab to display the Options page.
- <optional> Select the Check Model check box if you want to verify the validity of your model before generation.
- Select a value for each required option.
- Click the Tasks tab to display the Tasks page.
- Select the required task(s).
- Click OK to generate.
A Progress box appears. 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.
Copyright (C) 2005. Sybase Inc. All rights reserved.
|
|