Importing generated classes in another tempalte

  • 45
  • 3

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

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


Hi Mirko,

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

Regards,

Rainer

Hi Rainer,

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

Mirko