Hi,
Suppose the following classes/interfaces are given:
interface IA { }
public final class A implements IA {
IB b;
@Inject
public A(IB b) { this.b = b; }
}
public final class A2 implements IA { }
interface IB { }
public final class B implements IB {
IA a;
@Inject
public B(IA a) { this.a = a; }
}
public final class B2 implements IB { }
Ie. there are two implementations of IB, one of which depends on IA, and
there are two implementations of IA, one of which depends on IB.
Is it possible to create a single injector for which:
(a) injector.getInstance(IA.class) returns an instance of A whose field
'b' is an instance of B2,
(b) injector.getInstance(IB.class) returns an instance of B whose field
'a' is an instance of A2, and
(c) no extra annotations are added to the above classes.
Apologies if this actually has a straightforward solution. Examples
appreciated.
--
You received this message because you are subscribed to the Google Groups
"google-guice" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-guice.
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-guice/b30fa4f3-c3e2-42e7-bd4d-d2154af443ec%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.