[TCS] ModelAdapter.createEnumLiteral [message #4360] |
Fri, 29 February 2008 05:13  |
Eclipse User |
|
|
|
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   |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
> 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.
|
|
|
Powered by
FUDForum. Page generated in 0.06243 seconds