Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Runtime meta data with generic concept
Runtime meta data with generic concept [message #508968] Wed, 20 January 2010 22:23 Go to next message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
Hi All,

In e4, we run into a problem with generic type in runtime. It seems the
generic types lost in runtime same as standard generic of Java .

For example, we have a class MMenu,

public interface MMenu extends MUIElement, MElementContainer<MMenuItem> {
}

I cannot find the MMenuItem type in the EClass MMenu during the runtime, and
we can add what ever we want through the generic API like

menu.getChildrend().add(anObject);

Can someone confirm the observation? Is there a way to get the generic
type.?

Regards
Yves YANG
Re: Runtime meta data with generic concept [message #508970 is a reply to message #508968] Wed, 20 January 2010 22:46 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33140
Registered: July 2009
Senior Member
Yves,

Comments below.

Yves YANG wrote:
> Hi All,
>
> In e4, we run into a problem with generic type in runtime. It seems the
> generic types lost in runtime same as standard generic of Java .
>
> For example, we have a class MMenu,
>
> public interface MMenu extends MUIElement, MElementContainer<MMenuItem> {
> }
>
> I cannot find the MMenuItem type in the EClass MMenu during the runtime, and
> we can add what ever we want through the generic API like
>
> menu.getChildrend().add(anObject);
>
I'm not sure the type of his feature.
> Can someone confirm the observation? Is there a way to get the generic
> type.?
>
Yes, it does work pretty much like Java. You can get at the generic
type information in the model itself, but an EObject will only answer
its EClass, not an EGenericType.
> Regards
> Yves YANG
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Runtime meta data with generic concept [message #508974 is a reply to message #508970] Wed, 20 January 2010 23:16 Go to previous message
Yves YANG is currently offline Yves YANGFriend
Messages: 688
Registered: July 2009
Senior Member
Thanks Ed,

yves
"Ed Merks" <Ed.Merks@gmail.com> wrote in message
news:hj8150$33d$1@build.eclipse.org...
> Yves,
>
> Comments below.
>
> Yves YANG wrote:
>> Hi All,
>>
>> In e4, we run into a problem with generic type in runtime. It seems the
>> generic types lost in runtime same as standard generic of Java .
>>
>> For example, we have a class MMenu,
>>
>> public interface MMenu extends MUIElement, MElementContainer<MMenuItem> {
>> }
>>
>> I cannot find the MMenuItem type in the EClass MMenu during the runtime,
>> and we can add what ever we want through the generic API like
>>
>> menu.getChildrend().add(anObject);
>>
> I'm not sure the type of his feature.
>> Can someone confirm the observation? Is there a way to get the generic
>> type.?
>>
> Yes, it does work pretty much like Java. You can get at the generic type
> information in the model itself, but an EObject will only answer its
> EClass, not an EGenericType.
>> Regards
>> Yves YANG
>>
>>
Previous Topic:EObject to String
Next Topic:[Transaction] Editor to use single write transaction to modify EMF model until disposed
Goto Forum:
  


Current Time: Wed Apr 24 15:59:46 GMT 2024

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

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

Back to the top