Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Intermediate properties for EObject ?
icon5.gif  Intermediate properties for EObject ? [message #1593518] Fri, 30 January 2015 18:04 Go to next message
Preetam Palwe is currently offline Preetam PalweFriend
Messages: 9
Registered: October 2014
Junior Member
Hello there ...

May be quite naive question but still ...

I designed an ecore model and also generated java classes from it (using corresponding gen model) . I am using this model in a QVTO to perform this model to some other (xml) model transformation.

I came across a scenario where in I wanted to store an attribute to one of my model classes for a temporary reasons - I do not want to change the metamodel since its not "real" metadata attribute - and use that attribute in the QVTO.

In QVTO terminology I want to achieve something like but across Java and QVTO ...
intermediate property SomeModelClass::someTemporaryAttribute : TemporaryAttribute;

Means I want the attribute to be available in Java model so that I can populate it there and then when QVTO is invoked I can access it in QVTO ...

Is there any standard way available in EMF / EObject to achieve this kind of scenario ???

Any help in this regards is highly appreciated ...

Many Thanks !

Re: Intermediate properties for EObject ? [message #1594236 is a reply to message #1593518] Sat, 31 January 2015 05:39 Go to previous messageGo to next message
Preetam Palwe is currently offline Preetam PalweFriend
Messages: 9
Registered: October 2014
Junior Member
Hi

One thing I did was I added an attribute in the one of the generated Java model class (and NOT in ecore) with @generated NOT annotation so that I can populate the Java model with this temporary attribute but its not getting reflected in QVTO or in other words I am not able to access the newly added java attribute in QVTO
Any thoughts - why this might be the case ?
Re: Intermediate properties for EObject ? [message #1594368 is a reply to message #1594236] Sat, 31 January 2015 07:49 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
I can't answer how QVTO works in detail, but I expect it uses Ecore
reflection, not pure Java reflection, so it really needs a modeled
attribute, which you can make transient so that it's not serialized.

On 31.01.2015 06:39, Preetam Palwe wrote:
> Hi
> One thing I did was I added an attribute in the one of the generated
> Java model class (and NOT in ecore) with @generated NOT annotation so
> that I can populate the Java model with this temporary attribute but its
> not getting reflected in QVTO or in other words I am not able to access
> the newly added java attribute in QVTO Any thoughts - why this might be
> the case ?


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Intermediate properties for EObject ? [message #1594415 is a reply to message #1594368] Sat, 31 January 2015 08:30 Go to previous messageGo to next message
Preetam Palwe is currently offline Preetam PalweFriend
Messages: 9
Registered: October 2014
Junior Member
Thanks Ed

But EMF / EObject etc does not provide any out of the box mechanism for my requirement right ? If thats the case then I will write something custom ...

Re: Intermediate properties for EObject ? [message #1594624 is a reply to message #1594415] Sat, 31 January 2015 11:54 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
I can't comment on what's possible or not with QVTO.


On 31.01.2015 09:30, Preetam Palwe wrote:
> Thanks Ed
>
> But EMF / EObject etc does not provide any out of the box mechanism for
> my requirement right ? If thats the case then I will write something
> custom ...
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Intermediate properties for EObject ? [message #1594716 is a reply to message #1594624] Sat, 31 January 2015 13:24 Go to previous messageGo to next message
Preetam Palwe is currently offline Preetam PalweFriend
Messages: 9
Registered: October 2014
Junior Member
No Ed ... I am talking about general EMF here and not QVTO ...

Do we have any mechanism to add any custom property / attribute to generated model class or in general EMF EObject ???
Re: Intermediate properties for EObject ? [message #1595102 is a reply to message #1594716] Sat, 31 January 2015 19:43 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33136
Registered: July 2009
Senior Member
No, there's no such thing as a custom property. What's described in the
Ecore model is all there is available. Of course you can add adapters
to eAdapters() and those could carry additional data. Or you can
maintain such data externally via a map. Or maybe
http://eclipse.org/facet/ helps.

On 31.01.2015 14:24, Preetam Palwe wrote:
> No Ed ... I am talking about general EMF here and not QVTO ...
> Do we have any mechanism to add any custom property / attribute to
> generated model class or in general EMF EObject ???


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Intermediate properties for EObject ? [message #1596140 is a reply to message #1595102] Sun, 01 February 2015 12:43 Go to previous message
Preetam Palwe is currently offline Preetam PalweFriend
Messages: 9
Registered: October 2014
Junior Member
Thanks Ed!
Previous Topic:ID of Eclipse sub menu
Next Topic:Base class retrieved value from eStaticClass() method
Goto Forum:
  


Current Time: Fri Apr 19 03:40:04 GMT 2024

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

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

Back to the top