Author Topic: Code generation of classes in a single file  (Read 3857 times)

Michal K

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Code generation of classes in a single file
« on: May 21, 2013, 11:01:27 pm »
Hi,
Is there a possibility to generate code for multiple classes in a single file - similar to how XSD schema is generated.
We need to generate OData EDM descriptor from our class model.
Thanks,
Michal

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Code generation of classes in a single file
« Reply #1 on: May 22, 2013, 12:17:16 am »
You can't unless you define a stereotype for a pseudo package class element that contains the classes you want to generate code for as nested elements. If you do so, you can provide code generation templates that write just one file for your pseudo package class.

HTH
Günther

DanG83616

  • EA User
  • **
  • Posts: 180
  • Karma: +0/-0
    • View Profile
Re: Code generation of classes in a single file
« Reply #2 on: May 22, 2013, 01:43:16 am »
When I specify the filename attribute to be the same, all the classes are generated into the same file. However, I'm using C++ so perhaps the built-in behavior of the generator is different from language to language.


Michal K

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Code generation of classes in a single file
« Reply #3 on: May 22, 2013, 02:23:49 am »
Quote
You can't unless you define a stereotype for a pseudo package class element that contains the classes you want to generate code for as nested elements. If you do so, you can provide code generation templates that write just one file for your pseudo package class.

That's what I've done. Thank you.

Michal

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: Code generation of classes in a single file
« Reply #4 on: May 22, 2013, 11:04:24 am »
If you're using a custom language, use the generate package source code dialog after setting all filenames to the same value.