Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » M2M (model-to-model transformation) » [ATL] Class reflection
[ATL] Class reflection [message #533256] Wed, 12 May 2010 18:26 Go to next message
Eclipse UserFriend
Originally posted by: morlop.removethis.gmail.com

Dear All,
I wonder if there is a way in ATL to find out the references and
atributes an element from a model has in a transformation. Something
similar to what Java has in its reflection API.

All the best,

V. López
Re: [ATL] Class reflection [message #533801 is a reply to message #533256] Mon, 17 May 2010 07:42 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
You can use the EMF reflective operations in ATL.
Let's say you have :
from s : AA!BB

you can do :
s.eClass() (this will get the EClass of that element) and then use the EMF Ecore APIs. ex : .eAllStructuralFeatures() or .eAllReferences() and so on.
Re: [ATL] Class reflection [message #533802 is a reply to message #533256] Mon, 17 May 2010 07:43 Go to previous messageGo to next message
Sylvain EVEILLARD is currently offline Sylvain EVEILLARDFriend
Messages: 556
Registered: July 2009
Senior Member
and then, instead of eSet or eGet, you can use refSetValue and refGetValue :

s.refSetValue($nameofthestructuralfeaturetoset,value)
s.refGetValue($nameofthestructuralfeaturetoset)
Re: [ATL] Class reflection [message #533815 is a reply to message #533802] Mon, 17 May 2010 08:05 Go to previous message
Eclipse UserFriend
Originally posted by: morlop.removethis.gmail.com

Thank you very much for your help.

El 17/05/2010 9:43, Sylvain EVEILLARD escribió:
> and then, instead of eSet or eGet, you can use refSetValue and
> refGetValue :
>
> s.refSetValue($nameofthestructuralfeaturetoset,value)
> s.refGetValue($nameofthestructuralfeaturetoset)
Previous Topic:[ATL]Can someone Check my below Ant Build file ,Why it generates error ?
Next Topic:exit
Goto Forum:
  


Current Time: Wed Apr 24 22:00:51 GMT 2024

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

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

Back to the top