Provider with parameterization?

2009-10-21 Thread Patrick Lightbody
I'm trying to integrate Velocity in to my Guice environment and thought it would be nice if I could abstract it to the point that my code could simply ask for a Template object and get back a template that represents a specific file (ie: foo.vm). My first attempt was very simple. I @Inject Templa

Re: Provider with parameterization?

2009-10-21 Thread Bob Lee
On Wed, Oct 21, 2009 at 9:31 AM, Patrick Lightbody wrote: > But then I was thinking, it'd be cool if I could somehow @Inject this: > > @Named("foo.vm") Provider templateProvider > ... > Template template = templateProvider.get(); > > Then my provider would somehow be able to detect that it should

Re: Provider with parameterization?

2009-10-21 Thread Patrick Lightbody
Bob, Cool - that's what I was thinking was the "right" way to do it, but was just curious if there was another way Patrick On Oct 21, 7:58 am, Bob Lee wrote: > On Wed, Oct 21, 2009 at 9:31 AM, Patrick Lightbody > wrote: > > > But then I was thinking, it'd be cool if I could somehow @Inject thi

Re: Provider with parameterization?

2009-10-21 Thread Dhanji R. Prasanna
On Thu, Oct 22, 2009 at 3:16 AM, Patrick Lightbody wrote: > > Bob, > Cool - that's what I was thinking was the "right" way to do it, but > was just curious if there was another way > The wrong way? jk Dhanji. ;) --~--~-~--~~~---~--~~ You received this message be

Re: Provider with parameterization?

2009-10-27 Thread Leigh Klotz
You might consider using a MapBinder instead of @Named, and then @Inject Map>. Leigh. On Oct 21, 9:16 am, Patrick Lightbody wrote: > Bob, > Cool - that's what I was thinking was the "right" way to do it, but > was just curious if there was another way > > Patrick > > On Oct 21, 7:58 am, Bob Lee