Skip to content

Tag: guice

Expose Map from guice private Module

I am trying to expose a map from private module similar to Expose Map in private guice module but getting an error Could not expose() java.util.Map annotated with @com.google.inject.name.Named(value=myMap), it must be explicitly bound. I have written this code: Also in another class where I am injecting it, i…

traverse an array in GUI Java

I am doing a questionnaire with questions and written answers. I need that when adding the answer, press the main button, tell me if it is correct or not and show me the other question of the array, until the array is finished. Here I upload the whole code. Answer You have the right idea, but you need to proc…

Bootstrapping Guice injector

I have a scenario where I will need some objects injecting at the start like logging, but then other objects injected on demand. What I don’t know is if in my console application, do I just call: in my Main function and then when I need another object, the type that I need on demand, do I use a Provider

Guice injector in JUnit tests [closed]

Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 years ago. Improve this question Using Guice, is it a good practice to get a new injector in each JUni…