Interface PresenterFactory
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
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.
- Author:
- airhacks.com
-
Method Summary
Modifier and TypeMethodDescriptionstatic Iterable<PresenterFactory>
discover()
<T> T
instantiatePresenter
(Class<T> clazz, Function<String, Object> injectionContext) This method method replaces the standard afterburner dependency injection.
-
Method Details
-
instantiatePresenter
This method method replaces the standard afterburner dependency injection.- Type Parameters:
T
- the type of the presenter- Parameters:
clazz
- presenter class containing the default constructor.injectionContext
- a cache of already instantiated and initialized instances.- Returns:
- a fully initialized presenter with injected dependencies.
-
discover
- Returns:
- all discovered implementations of PresenterFactory using the
ServiceLoader
mechanism
-