On Jun 6, 8:48 am, Johannes Schneider <maili...@cedarsoft.com> wrote:
>         bind( ( TypeLiteral<List<? extends B>> ) TypeLiteral.get(
> Types.listOf( Types.subtypeOf( new TypeLiteral<B<?>>() {
>         }.getType() ) ) ) ).toProvider( BProvider.class );

Not much I can really say - creating models for complex types code-
intensive. TypeLiteral works for some wildcards, and for the ones it
doesn't you can either use the Types factory class, or you can do
something reflective.
  private final List<? extends B<?> unused = null;
  private final TypeLiteral<List<? extends B<?>> type = fieldToType
(MyClass.class, unused);

  private static Type fieldToType(Class<?> definedIn, String name) {
    return definedIn.getDeclaredField(name).getGenericType();
  }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to google-guice@googlegroups.com
To unsubscribe from this group, send email to 
google-guice+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to