Importing generated classes in another tempalte Follow
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?
Please sign in to leave a comment.
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). :-)
does your homepage still exist? Your server (www.campago.de) does not respond.
sorry for the delay: Website is up and running again.
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 ;) ).