Search in sources :

Example 1 with FactoryModule

use of com.google.gwt.inject.client.assistedinject.FactoryModule in project google-gin by gwtplus.

the class BinderAdapter method install.

public void install(GinModule install) {
    // Filtering out fake factory modules.
    if (install instanceof FactoryModule) {
        if (bindings != null) {
            bindings.addFactoryModule((FactoryModule<?>) install);
        }
    } else {
        // Here we need to take care to ensure that PrivateGinModule uses the appropriate
        // type of adapter, and also get the corresponding Guice private binder.
        final Module moduleAdapter;
        if (install == null) {
            moduleAdapter = null;
        } else if (install instanceof PrivateGinModule) {
            moduleAdapter = new PrivateGinModuleAdapter((PrivateGinModule) install, bindings);
        } else {
            moduleAdapter = new GinModuleAdapter(install, bindings);
        }
        binder.install(moduleAdapter);
    }
}
Also used : PrivateGinModule(com.google.gwt.inject.client.PrivateGinModule) FactoryModule(com.google.gwt.inject.client.assistedinject.FactoryModule) Module(com.google.inject.Module) GinModule(com.google.gwt.inject.client.GinModule) FactoryModule(com.google.gwt.inject.client.assistedinject.FactoryModule) PrivateGinModule(com.google.gwt.inject.client.PrivateGinModule)

Aggregations

GinModule (com.google.gwt.inject.client.GinModule)1 PrivateGinModule (com.google.gwt.inject.client.PrivateGinModule)1 FactoryModule (com.google.gwt.inject.client.assistedinject.FactoryModule)1 Module (com.google.inject.Module)1