Skip to content
Advertisement

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, it gives: No implementation for java.util.Map<java.lang.String, java.lang.String> was bound. Please check. thanks

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 process

Google Guice and Lombok – @AllArgsConstructor(onConstructor = @__(@Inject)) for abstract class

I find @AllArgsConstructor(onConstructor = @__(@Inject)) is helpful to keep code clean when working with Google Guice. I can save the constructor code. For example: For abstract class, I’m able to use @Inject for constructor. Is it possible to save the constructor code in ChildClass by using something like @AllArgsConstructor(onConstructor = @__(@Inject))? Answer No, it is not possible to define AllArgsConstructor

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 JUnit test class, as each test class

Advertisement