Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [e4-dev] E4 Formal API Part 2: UI Model

So having

@Inject
void setPerson(List<Person> l){}

and

@Inject
List<Person> l;

is in general supported by the logic that extracts the "to-be-injected" values? It's only not yet leveraged by the DI framework that does the injection?

Marcel


On Mar 8, 2013, at 9:47 PM, Brian de Alwis <briandealwis@xxxxxxxxx> wrote:

The typing information is available using IObjectDescriptor#getDesiredType().

http://git.eclipse.org/c/platform/eclipse.platform.runtime.git/tree/bundles/org.eclipse.e4.core.di/src/org/eclipse/e4/core/di/suppliers/IObjectDescriptor.java

Brian.

On 8-Mar-2013, at 2:49 AM, Marcel Bruch wrote:


On Mar 8, 2013, at 8:05 AM, "Toedter, Kai" <kai.toedter@xxxxxxxxxxx> wrote:

Marcel wrote
The information about generics is still in the bytecode.
I thought the "Type Erasure" implementation of generics erases everything related to generics at compile time.
What information is available at runtime?

See [1] for a brief example. It's in the attributes of a field/method and can be found in the constant pool. I'm not very familiar with the details but the (a lot) information can be reconstructed from bytecode otherwise Guice couldn't inject my generic fields. For details, the JVM spec is the reference to look at I guess :-)

Best,
Marcel



Best regards,

Kai

-----Original Message-----
From: e4-dev-bounces@xxxxxxxxxxx [mailto:e4-dev-bounces@xxxxxxxxxxx]
On Behalf Of Marcel Bruch
Sent: Freitag, 8. März 2013 07:57
To: E4 Project developer mailing list
Subject: Re: [e4-dev] E4 Formal API Part 2: UI Model


On Mar 8, 2013, at 7:30 AM, Lars Vogel <lars.vogel@xxxxxxxxx> wrote:

Not with generics. Would be awesome to have.

That is a Java thing, generics are not available at runtime.

The information about generics is still in the bytecode. DI frameworks like
guice and spring can handle generics (with some limitations) and eclipse
could do so too. the question about generics pops up quite often during
training or hands-ons.
_______________________________________________
e4-dev mailing list
e4-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/e4-dev
_______________________________________________
e4-dev mailing list
e4-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/e4-dev

_______________________________________________
e4-dev mailing list
e4-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/e4-dev

_______________________________________________
e4-dev mailing list
e4-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/e4-dev


Back to the top