Package dagger.android
Class DispatchingAndroidInjector<T>
java.lang.Object
dagger.android.DispatchingAndroidInjector<T>
- Type Parameters:
T- the core Android type to be injected
- All Implemented Interfaces:
AndroidInjector<T>
Performs members-injection on instances of core Android types (e.g.
Activity, Fragment) that are constructed by the Android framework and not by Dagger. This class relies on
an injected mapping from each concrete class to an AndroidInjector.Factory for an AndroidInjector of that class. Each concrete class must have its own entry in the map, even if
it extends another class which is already present in the map. Calls Object.getClass() on
the instance in order to find the appropriate AndroidInjector.Factory.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classException thrown if an incorrect binding is made for aAndroidInjector.Factory.Nested classes/interfaces inherited from interface dagger.android.AndroidInjector
AndroidInjector.Builder<T>, AndroidInjector.Factory<T> -
Method Summary
Modifier and TypeMethodDescriptionvoidPerforms members-injection oninstance.booleanmaybeInject(T instance) Attempts to perform members-injection oninstance, returningtrueif successful,falseotherwise.
-
Method Details
-
maybeInject
Attempts to perform members-injection oninstance, returningtrueif successful,falseotherwise.- Throws:
DispatchingAndroidInjector.InvalidInjectorBindingException- if the injector factory bound for a class does not inject instances of that class
-
inject
Performs members-injection oninstance.- Specified by:
injectin interfaceAndroidInjector<T>- Throws:
DispatchingAndroidInjector.InvalidInjectorBindingException- if the injector factory bound for a class does not inject instances of that classIllegalArgumentException- if noAndroidInjector.Factoryis bound forinstance
-