public interface PresenterFactory
The implementation of this interface is fully optional and only needed in
case you would like to replaced the default Dependency Injection mechanism.
Afterburner will discover the implementations of this interface using the Java extension mechanism.
You will have to register the an implementation by placing a text file:
META-INF/services/com.airhacks.afterburner.injection.PresenterFactory
containing the fully qualified name of the implementation.
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungstatic PresenterFactorydiscover()voidinjectMembers(Object instance, Function<String, Object> injectionContext) Populate the given object.<T> TinstantiatePresenter(Class<T> clazz, Function<String, Object> injectionContext) This method method replaces the standard afterburner dependency injection.
-
Methodendetails
-
discover
- Gibt zurück:
- the discovered implementations of PresenterFactory using the
ServiceLoadermechanism
-
instantiatePresenter
This method method replaces the standard afterburner dependency injection.- Typparameter:
T- the type of the presenter- Parameter:
clazz- presenter class containing the default constructorinjectionContext- a cache of already instantiated and initialized instances- Gibt zurück:
- a fully initialized presenter with injected dependencies.
-
injectMembers
Populate the given object. For example, set all fields annotated withInject.- Parameter:
instance- the object to inject members intoinjectionContext- a cache of already instantiated and initialized instances
-