Runtime meta data with generic concept [message #508968] |
Wed, 20 January 2010 17:23  |
Eclipse User |
|
|
|
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 17:46   |
Eclipse User |
|
|
|
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
>
>
>
|
|
|
Re: Runtime meta data with generic concept [message #508974 is a reply to message #508970] |
Wed, 20 January 2010 18:16  |
Eclipse User |
|
|
|
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.03912 seconds