Skip to main content


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: 7655
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] How to generate a sequence (bag) of consecutive integers starting at 1
Next Topic:[ACCELEO] Using OCL Invocation and Setting delegates
Goto Forum:
  


Current Time: Tue Apr 16 19:43:12 GMT 2024

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

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

Back to the top