Search in sources :

Example 1 with OutputModule

use of com.google.gwt.inject.rebind.output.OutputModule in project google-gin by gwtplus.

the class GinjectorGeneratorModule method configure.

@Override
protected void configure() {
    install(new ResolutionModule());
    install(new OutputModule());
    bind(TreeLogger.class).toInstance(logger);
    bind(GeneratorContext.class).toInstance(ctx);
    bind(new TypeLiteral<Class<? extends Ginjector>>() {
    }).annotatedWith(GinjectorInterfaceType.class).toInstance(ginjectorInterface);
    bind(GinjectorBindings.class).annotatedWith(RootBindings.class).to(GinjectorBindings.class).in(Singleton.class);
    bind(BindingIndex.class).to(Key.get(GinjectorBindings.class, RootBindings.class)).in(Singleton.class);
    install(new FactoryModuleBuilder().build(GuiceElementVisitor.GuiceElementVisitorFactory.class));
    bind(new TypeLiteral<Set<Class<? extends GinModule>>>() {
    }).annotatedWith(ModuleClasses.class).toInstance(moduleClasses);
    bind(BindingFactory.class).to(BindingFactoryImpl.class);
    install(new FactoryModuleBuilder().build(SourceWriteUtil.Factory.class));
}
Also used : Set(java.util.Set) FactoryModuleBuilder(com.google.inject.assistedinject.FactoryModuleBuilder) BindingFactory(com.google.gwt.inject.rebind.binding.BindingFactory) GeneratorContext(com.google.gwt.core.ext.GeneratorContext) OutputModule(com.google.gwt.inject.rebind.output.OutputModule) ResolutionModule(com.google.gwt.inject.rebind.resolution.ResolutionModule) TreeLogger(com.google.gwt.core.ext.TreeLogger) Ginjector(com.google.gwt.inject.client.Ginjector) BindingFactory(com.google.gwt.inject.rebind.binding.BindingFactory)

Aggregations

GeneratorContext (com.google.gwt.core.ext.GeneratorContext)1 TreeLogger (com.google.gwt.core.ext.TreeLogger)1 Ginjector (com.google.gwt.inject.client.Ginjector)1 BindingFactory (com.google.gwt.inject.rebind.binding.BindingFactory)1 OutputModule (com.google.gwt.inject.rebind.output.OutputModule)1 ResolutionModule (com.google.gwt.inject.rebind.resolution.ResolutionModule)1 FactoryModuleBuilder (com.google.inject.assistedinject.FactoryModuleBuilder)1 Set (java.util.Set)1