Book a Demo

Author Topic: java code generation problem  (Read 2934 times)

mschulz

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
java code generation problem
« on: April 05, 2004, 10:30:42 am »
Just downloaded and installed EA 4.0 rev 724 to make sure I have the latest code.  Opened the "Logical Model"  package, created a subpackage named "Test".  Created a class diagram in the test package. Dropped a new class on the diagram, titled "Class1".  Created a single attribute named test1.  Generated the code using java as my language choice.

Here is the file that was generated:

package Logical Model.test;

/**
* @author mschulz
* @version 1.0
* @created 05-Apr-2004 12:34:41 PM
*/
public class Class1 {

     private int test;

     public Class1(){

     }

}


The question is: how do I remove the first level package name from my generated classes? Obviously, my packages don't start with "Logical Model" - I want the class to appear in the package test!

-Mike
« Last Edit: April 05, 2004, 10:36:36 am by mschulz »

mschulz

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: java code generation problem
« Reply #1 on: April 05, 2004, 10:55:58 am »
Ok, so I get to answer my own question....duh.  
When you right-click on any package in the project browser, the popup menu which appears contains a menu item named "Package Control", which is also a submenu.  When the Package Control submenu is displayed, one of the options on the menu is "Set as Namespace Root".  Setting this option will generate the correct package declaration in the java source file.

So, once I declare the package "Logical Model" as a namespace root, the code generates the proper package statement.
-Mike

p.s. This information is in the EA User Guide.pdf file, which is a very good document.  I should have read the document before posting to this list.
:P