Book a Demo

Author Topic: Generate code of packages  (Read 3368 times)

ch

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Generate code of packages
« on: January 10, 2008, 05:03:45 am »
Hi all,
I have a few uml-diagrams of different classes. All classes belong to the same package.
For example:
package=media
class1=book
class2=dvd

Now I want to write a new code generator. The output file should look like this:
package media{
 class book{
 }
 class dvd{
 }
}

Is this possible? At the moment EA creates one file for each class. Template "namespace" contains the line
%list="Class" @separator="\n\n" @indent="\t"%
This means that EA call template "Class" for each class of the package, doesn't?
Can everyone help?
Thanks in advance,
leene

JimmyJazz

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Generate code of packages
« Reply #1 on: February 19, 2008, 03:06:00 pm »
Leene, did you find an answer to this? I would like to do the same.

ch

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: Generate code of packages
« Reply #2 on: March 05, 2008, 02:42:15 am »
Hi, yes I have :-)
Sorry for late message...
First you must generate each class, but every time write to path the same filename. After this, you can go to project->source code engineering->generate package source code. Now, select all classes and "generate" :-)

Greets,
leene

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: Generate code of packages
« Reply #3 on: March 05, 2008, 04:56:18 am »
I cannot remember if there is an option to overwrite existing files. If there is, you probably want to clear it before you write (the second and subsequent) code segments.
No, you can't have it!