问题
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?
回答1:
As suggested above, probably provider is the way to do it. it is also mentioned in this question.
来源:https://stackoverflow.com/questions/9819794/how-to-create-an-object-from-a-different-scope