Importing generated classes in another tempalte

Hi,

i m generating a couple of entities as Pojo s with MPS, what is quite easy to do. MPS does generate all necessary imports automatically.

Now i m looking for a simple java class (with a main()) where some of these Pojo s are instantiated. Therefore i used a conditional root rule in

the generator to create that additional main-class, which of course should somehow also import generated Pojo s. How should i do that?

Best,

Dan

0
4 comments
Avatar
Permanently deleted user

Hi daniel,

just create a jetbrains.mps.baseLanguage.structure.ClassifierType referencing the jetbrains.mps.baseLanguage.structure.Classifier (your Pojos) you desire within your generated model. All you need is to have your Classifiers within your generated model or at least you imported them into that model. The class with the main then only creates the ClassifierType instances ...

... or you could f.i. have a look at my homepage (www.compago.de) at the tutorial "Extending MPS BaseLanguage by Example" at http://www.compago.de/confluence/display/md/Extending+MPS+BaseLanguage+by+Example+-+English. I solve very similar things there (search for "ClassifierType" within the one-page-version). :-)

Regards,

Mirko

0
Avatar
Permanently deleted user
Hi Mirko,

does your homepage still exist? Your server (www.campago.de) does not respond.

Regards,

Rainer
0
Avatar
Permanently deleted user
Hi Rainer,

sorry for the delay: Website is up and running again.

Mirko
0
Avatar
Permanently deleted user
Hi all,

after an attack followed by a total crash of my confluence instance in November 2011, i found the time to recover most of the stuff i published there... still several issues, i know, but the contents can be read and the screenshots are there (although they are now linked to a new page ... sorry for that -  i try to fix that soon).

To visit my docs, go to www.compago.de / port 8090 (i do not want to have google index that yet ;) ).

Cheers,
Mirko
0

Please sign in to leave a comment.