|
Re: Runtime meta data with generic concept [message #508970 is a reply to message #508968] |
Wed, 20 January 2010 22:46 |
Ed Merks 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 |
Yves YANG 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
>>
>>
|
|
|
Powered by
FUDForum. Page generated in 0.03928 seconds