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 TemplateEngine, which is a
@Singleton, and then just call:

Template template = templateEngine.getTemplate("foo.vm");

Easy.

But then I was thinking, it'd be cool if I could somehow @Inject this:

@Named("foo.vm") Provider<Template> templateProvider
...
Template template = templateProvider.get();

Then my provider would somehow be able to detect that it should be
associated with "foo.vm" and return the right value.

Is something like this possible?

Patrick

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