public class MyGinModule extends AbstractGinModule { @Override protected void configure() { bind(MyInterface.class).to(MyImplementation.class); bind(AnotherInterface.class).toProvider(AnotherProvider.class); } @Provides public MyDependency provideMyDependency() { return new MyDependency(); } } Injector injector = GWT.create(Injector.class); MyInterface myObject = injector.getInstance(MyInterface.class); <inherits name='com.google.gwt.inject.Inject'/>


上一篇:
下一篇:
切换中文