So I create an instance of a class using
injector.getInstance(Someclass.class);
this returns me an instance of Someclass
what I want is at the point of the injection for Someclass to have a reference to "this" ie. the instance where I'm performing
the injection.
I don't want Guice to create a new object as this object already exists.
public Class A {
public createSomeclass() {
SomeModule module = new Module
return injector.getInstance(Someclass.class)
}
}
So I want the instance of Someclass to have a reference of the instance of Class A where the inject is taking place.
So how do I do this without needing to write someClassInstance.setClassAReference(this)
Currently Guice is not responsible for instantiating the instance of class A.