[JBoss JIRA] (CDI-455) Allow building of TypeLiteral's with dynamic types

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[JBoss JIRA] (CDI-455) Allow building of TypeLiteral's with dynamic types

JIRA issues@jboss.org

    [ https://issues.jboss.org/browse/CDI-455?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13467709#comment-13467709 ]

Martin Kouba commented on CDI-455:
----------------------------------

I think we should add {{Event.select()}} and {{Instance.select()}} variants which also accept {{java.lang.reflect.Type}}. The argument should be checked at runtime and {{IllegalArgumentException}} should be thrown if the type is not a subtype of the event/required type.

Also the trick with {{ChocolateEater}} described above would only work for simple parameterized types and not for more complex use cases.

> Allow building of TypeLiteral's with dynamic types
> --------------------------------------------------
>
>                 Key: CDI-455
>                 URL: https://issues.jboss.org/browse/CDI-455
>             Project: CDI Specification Issues
>          Issue Type: Feature Request
>            Reporter: Lucas Ventura Carro
>             Fix For: 2.1 (Discussion)
>
>
> It could be useful the building of {{TypeLiteral}}'s, but using dynamic types. This way, the types can be indicated at runtime and not in compile. This functionality is "doable" as it is done at [Guice|https://github.com/google/guice], a similar injection framework, and as [this post shows|http://luisfsgoncalves.wordpress.com/2010/09/08/generic-bindings-with-guice/].



--
This message was sent by Atlassian JIRA
(v7.2.3#72005)
_______________________________________________
cdi-dev mailing list
[hidden email]
https://lists.jboss.org/mailman/listinfo/cdi-dev

Note that for all code provided on this list, the provider licenses the code under the Apache License, Version 2 (http://www.apache.org/licenses/LICENSE-2.0.html). For all other ideas provided on this list, the provider waives all patent and other intellectual property rights inherent in such information.