Book a Demo

Author Topic: own MDG Tech  (Read 3862 times)

ToniPepperoni

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
own MDG Tech
« on: August 21, 2013, 07:42:46 pm »
Hello guys,
I am currently working on our own MDG Technology for a specific programming language. This MDG contains, among other templates, a Code Template. After a long search in the documention-jungle of EA, I figured out how this works (more or less), but there are still some questions.

1. I am wondering why my Output-Files ends up with ".java". Where can I change the File-Ending?

2. I did not want to start from scratch, so I copied some Template-Contents from Java and others (but I worked on a new Template). For example I wanted the package-path from a class. In Java you get this in the following way:

%if packagePath != "" and packagePath != "." and packagePath != ".\\"%
package %packagePath%;
%endIf%

The Output is:
... package ParentPackage.ChildPackage; ....

When I copy the Template (without changing it) my output is:
... package ParentPackage; ....

What am I doing wrong?

3. Similar Problem with:

%if importInFile=="T" or importPackagePath=="" or importPackagePath==packagePath%
%endTemplate%

If the connected file is in the same package this validation should come to "endTemplate", but when I use that it does not work as in java :/


Thank you very much.

Best Regards,
Toni

Edit: Add 3. and I use EA in Version 9.3.935
« Last Edit: August 21, 2013, 10:18:10 pm by ToniPepperoni »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: own MDG Tech
« Reply #1 on: August 22, 2013, 08:53:35 am »
There's a special case in the way the Java templates are called. It starts off at the file template with the deepest package already in context.

It's not ideal, but we're stuck with it since it's been around longer than me. Users will have written customized templates for Java and other languages and I for one don't want them broken.

To get what you want working you want something closer to the Actionscript template.

Package
Code: [Select]
%list="Namespace" @separator="\n\n" @indent=""%
Namespace
Quote
%if packageHasGenClasses == "T"%
package %packageName%
%endIf%

%list="Namespace" @separator="\n\n" @indent=""%
%list="Class" @separator="\n\n" @indent=""%


ToniPepperoni

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile
Re: own MDG Tech
« Reply #2 on: August 22, 2013, 09:59:37 pm »
Thanks for your reply, Simon.
But I still do not understand from where the ".java"-endings come from :-/ Is there a way to determine the ending of the files?

Regards,
Toni

ToniPepperoni

  • EA Novice
  • *
  • Posts: 13
  • Karma: +0/-0
    • View Profile