Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Constructing generic objects
Constructing generic objects [message #777098] Mon, 09 January 2012 20:53 Go to next message
Michael Spertus is currently offline Michael SpertusFriend
Messages: 78
Registered: July 2009
Member
I used the sample editor to create some generic classes (after enabling "show generics") such Foo<T>. When I use the generated EMF editor to create a Foo object, I don't see any way to specify what T is. Is there any way to do that (or does type erasure render this moot)?

Thanks,

Mike
Re: Constructing generic objects [message #777117 is a reply to message #777098] Mon, 09 January 2012 21:59 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33142
Registered: July 2009
Senior Member
Mike,

No, there's no way to do this. There's no information available at
runtime that would represent it. The same is the case for Java, i.e,
you can call getClass, and perhaps determine it's java.util.List, but
not that it's java.util.List<java.lang.Integer>.


On 09/01/2012 9:53 PM, Michael Spertus wrote:
> I used the sample editor to create some generic classes (after
> enabling "show generics") such Foo<T>. When I use the generated EMF
> editor to create a Foo object, I don't see any way to specify what T
> is. Is there any way to do that (or does type erasure render this moot)?
>
> Thanks,
>
> Mike


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:[EMF Query 2] Trouble with the import line in *.query file
Next Topic:Target Platform ecore model can't be resolved
Goto Forum:
  


Current Time: Sat Apr 27 00:37:30 GMT 2024

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

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

Back to the top