oshai
oshai

Reputation: 15365

how to create an object from a different scope

I have an object in Guice with scope singleton. In method f() I want to create a new object but let Guice do the injection. I think it is not a good practice to pass the injector around.
So how can I get a new "Guicy" instance of object?

Upvotes: 3

Views: 156

Answers (1)

oshai
oshai

Reputation: 15365

As suggested above, probably provider is the way to do it. it is also mentioned in this question.

Upvotes: 2

Related Questions