Class FactoryModule
- java.lang.Object
-
- com.google.inject.AbstractModule
-
- com.google.gerrit.extensions.config.FactoryModule
-
- All Implemented Interfaces:
com.google.inject.Module
- Direct Known Subclasses:
AccessControlModule
,CacheModule
,CmdLineParserModule
,DefaultPermissionBackendModule.LegacyControlsModule
,DefaultSubmitRule.Module
,EmailModule
,GerritRequestModule
,GitModule
,GroupDbModule
,GroupModule
,com.google.gerrit.lifecycle.LifecycleModule
,NoteDbModule
,PrologModule
,RestApiModule
public abstract class FactoryModule extends com.google.inject.AbstractModule
-
-
Constructor Summary
Constructors Constructor Description FactoryModule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
factory(Class<?> factory)
Register an assisted injection factory.-
Methods inherited from class com.google.inject.AbstractModule
addError, addError, addError, bind, bind, bind, bindConstant, binder, bindInterceptor, bindListener, bindListener, bindScope, configure, configure, convertToTypes, currentStage, getMembersInjector, getMembersInjector, getProvider, getProvider, install, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
-
-
-
Method Detail
-
factory
protected void factory(Class<?> factory)
Register an assisted injection factory.This function provides an automatic way to define a factory that creates a concrete type through assisted injection. For example to configure the following assisted injection case:
public class Foo { public interface Factory { Foo create(int a); } @Inject Foo(Logger log, @Assisted int a) {...} }
Just passFoo.Factory.class
to this method. The factory will be generated to return its one return type as declared in the creation method.- Parameters:
factory
- interface which specifies the bean factory method.
-
-