what do you wish to configure?

You want that the generated IPageFactory instance will allow to create
instances of PageWebCrud?

But how do you expect to retrieve injected assisted values in your
PageWebCrud objects?

Anthony


2010/2/4 Cristiano <[email protected]>

> 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]<google-guice%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
>
>

-- 
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.

Reply via email to