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
,ApprovalModule
,CacheModule
,CmdLineParserModule
,DefaultSubmitRule.DefaultSubmitRuleModule
,EmailModule
,GerritRequestModule
,GitModule
,GroupDbModule
,GroupModule
,HttpdModule
,com.google.gerrit.lifecycle.LifecycleModule
,NoteDbDraftCommentsModule
,NoteDbModule
,NoteDbStarredChangesModule
,RepoSequence.RepoSequenceModule
,RestApiModule
,RestModule
public abstract class FactoryModule
extends com.google.inject.AbstractModule
-
Constructor Summary
Constructors -
Method Summary
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, requestInjection, requestStaticInjection, requireBinding, requireBinding
-
Constructor Details
-
FactoryModule
public FactoryModule()
-
-
Method Details
-
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.
-