You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by uud ashr <uu...@gmail.com> on 2009/10/27 11:52:22 UTC
GuiceInjector
Hi,
I need to use InjectorHolder.getInjector().inject(...) but I'm using Guice
(not Spring), I searching trough the code but I can't find how to do
InjectorHolder.setInjector(...a guice injector...).
Can someone (comitters) add GuiceInjector, it will be looks like:
import org.apache.wicket.injection.ConfigurableInjector;
import org.apache.wicket.injection.IFieldValueFactory;
import com.google.inject.Injector;
public class GuiceInjector extends ConfigurableInjector {
private final Injector injector;
public GuiceInjector(Injector injector) {
this.injector = injector;
}
@Override
public Object inject(Object object) {
injector.injectMembers(object);
return object;
}
@Override
protected IFieldValueFactory getFieldValueFactory() {
// You don't have to do nothing here
return null;
}
}
It just wrapper class.
Thanks & Regards,
uudashr