Skip to main content



      Home
Home » Modeling » TMF (Xtext) » [TCS] ModelAdapter.createEnumLiteral
[TCS] ModelAdapter.createEnumLiteral [message #4360] Fri, 29 February 2008 05:13 Go to next message
Eclipse UserFriend
Hi,

I am wondering how to implement
ModelAdapter.createEnumLiteral(String name) for a generic EMF based
ModelAdapter implementation.
If my MetaModel has 2 different enumerations, but both have an EnumValue
with the same name, then how should the ModelAdapter know at this point
which Enumeration to use?
Also, in this case, the EnumLiteral would not really be "created", as it
would already be part of the metamodel, wouldn't it?
I see that ASMModelAdapter just does
ASMEnumLiteral ret = new ASMEnumLiteral(name);
So I assume that with ASMEnumLiteral, more than one instance for the same
Enum Literal is possible?
Re: [TCS] ModelAdapter.createEnumLiteral [message #4985 is a reply to message #4360] Tue, 11 March 2008 10:30 Go to previous messageGo to next message
Eclipse UserFriend
Hello,

The simplest way to implement createEnumLiteral for EMF is to do it the
way emf4atl does:
- you create it as an EnumLiteral (e.g., your own implementation)
- you find the correct literal only at assignment time (i.e., in set()).

By the way, we plan to have an EMFModelAdapter at some time.
It seems that you are ahead of us. Could you please consider
contributing it?


Thanks,

Frédéric Jouault

Thibault Kruse a écrit :
> Hi,
>
> I am wondering how to implement
> ModelAdapter.createEnumLiteral(String name) for a generic EMF based
> ModelAdapter implementation.
> If my MetaModel has 2 different enumerations, but both have an EnumValue
> with the same name, then how should the ModelAdapter know at this point
> which Enumeration to use? Also, in this case, the EnumLiteral would not
> really be "created", as it would already be part of the metamodel,
> wouldn't it?
> I see that ASMModelAdapter just does
> ASMEnumLiteral ret = new ASMEnumLiteral(name);
> So I assume that with ASMEnumLiteral, more than one instance for the
> same Enum Literal is possible?
>
Re: [TCS] ModelAdapter.createEnumLiteral [message #5190 is a reply to message #4985] Thu, 13 March 2008 06:18 Go to previous message
Eclipse UserFriend
> By the way, we plan to have an EMFModelAdapter at some time.
> It seems that you are ahead of us. Could you please consider
> contributing it?

It's not that I don't want to, it's more that my implementation is not
suitable for contribution, as I only made one single Adapter for a
specific metamodel, and that one in a way I'd be ashamed to show to
anyone. The creation of a generic EMF ModelAdapter is not within my
current tasks, else I would be happy to contribute. My task is to create a
ModelAdapter for custom-MOF, which I will not be able to contribute
neither.
Previous Topic:[TCS] TCSZoo XPath
Next Topic:[TCS] NullPointerException with builder setup
Goto Forum:
  


Current Time: Thu May 08 14:52:02 EDT 2025

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

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

Back to the top