Hi people,
Someone could help me figure out if is possible and how could I bind a
generic factory like the one below using guice?
public interface IPageFactory<PAGE extends IPage> {
PAGE createPage(@Assisted("id")String pId, @Assisted("title") String
pTitle, @Assisted("path") String pPath);
}
public interface IPageCrud extends IPage
{
}
public class PageWebCrud implements IPageCrud
{
}
I saw this on docs:
bind(PaymentFactory.class).toProvider(
FactoryProvider.newFactory(PaymentFactory.class,
RealPayment.class));
and I've tried something like that but didn't compile :
bind(new TypeLiteral<IPageFactory<IPageCrud>>() {
}).toProvider(
FactoryProvider.newFactory(new
TypeLiteral<IPageFactory<PageWebCrud>>() {
}, new
TypeLiteral<PageWebCrud>(){}));
thanks
Cristiano
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-guice?hl=en.