Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » how to get a list of import packages
how to get a list of import packages [message #814990] Wed, 07 March 2012 04:47 Go to next message
Eclipse UserFriend
Hello.
I'm new to Acceleo and I'm working on my first template. I am
trying to generate java source code and need to get a list of packages
which need to be imported per class file. Any idea on how I could
accomplish this ? a [for] block with an OCL expression ?
Re: how to get a list of import packages [message #815066 is a reply to message #814990] Wed, 07 March 2012 07:23 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 5168
Registered: July 2009
Senior Member
Hi

You first need to compute the set of all references, then convert the
reference targets to a set of all target modules, exclude target modules
that do not need referencing (e.g the current module) and emit that set,
perhaps after alphabeticizing.

Computing the set of references requires knowledge of the meta-model to
identify all potential referencing classes. For instance if using Ecore
you would identify at least ETypedElement.eType, EOperation.eExceptions.
These can be found conveniently by using the type arguments of
eAllContents or filter.

Regards

Ed Willink


On 07/03/2012 04:47, ritz par wrote:
> Hello.
> I'm new to Acceleo and I'm working on my first template. I am
> trying to generate java source code and need to get a list of packages
> which need to be imported per class file. Any idea on how I could
> accomplish this ? a [for] block with an OCL expression ?
>
Previous Topic:[Acceleo] Class not found in invoke()
Next Topic:MWE: Caching XML Schema to ECORE transformation
Goto Forum:
  


Current Time: Wed Apr 26 18:14:21 GMT 2017

Powered by FUDForum. Page generated in 0.01917 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software