I have the below mentioned class in a library module, which the clients will use to interact with database. I have a public constructor that takes a parameter from the user of this library, but the …
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, …
Guice -How to inject dependency inside the class which is extending Abstract module – Java
I have to trigger TestDriver.startPoller() from EnvironmentModule since EnvironmentModule is extending from Abstractmodule I am not sure how to inject dependency inside EnvironmentModule is it even …
Why am I getting “classes must have either one (and only one) constructor” error?
I have been trying to get Guice working but end up with this: Classes must have either one (and only one) constructor My interface: The implementation: The binding module: The AddrBook client where I am injecting: And my main: After all this, I’m getting this error: I have experience with Spring and not with Guice. Where am I going wrong
Guice: Injecting map binding with @Named
I would like to have the following injection model. Is this possible with Guice? Module: protected void configure() { MapBinder
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
my Google Guice method interceptor doesn’t execute but Why?
So I am testing a simple Google Guice interceptor – My Annotation – @Retention(RetentionPolicy.RUNTIME) @Target(ElementType.METHOD) public @interface AppOpsOperation { } My Interceptor public …
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
Google Guice vs. PicoContainer for Dependency Injection
My team is researching dependency injection frameworks and is trying to decide between using Google-Guice and PicoContainer. We are looking for several things in our framework: A small code footprint – What I mean by a small code footprint is we don’t want to have dependency injection code litter everywhere in our code base. If we need to refactor down