Comment #10 on issue 369 by [email protected]: Convenient way to expose multibindings and mapbindings from PrivateModules
http://code.google.com/p/google-guice/issues/detail?id=369

My solution is to use expose in the configure method of the PrivateModule with the help of TypeLiteral and Types:

    expose((TypeLiteral<Map<String, MessageHandler>>) TypeLiteral.get(
        Types.mapOf(String.class, MessageHandler.class)));

I even have crazier stuff like:
expose((TypeLiteral<Set<Entry<String, Provider<MessageHandler>>>>) TypeLiteral.get(
        Types.setOf(Types.newParameterizedTypeWithOwner(
                                Map.class, Entry.class, String.class,
                                Types.providerOf(MessageHandler.class)))));

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice-dev.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to