Package dagger
Interface MembersInjector<T>
- Type Parameters:
T
- type to inject members of
public interface MembersInjector<T>
Injects dependencies into the fields and methods on instances of type
T
. Ignores the
presence or absence of an injectable constructor.- Since:
- 2.0 (since 1.0 without the provision that
injectMembers(T)
cannot acceptnull
)
-
Method Summary
Modifier and TypeMethodDescriptionvoid
injectMembers
(T instance) Injects dependencies into the fields and methods ofinstance
.
-
Method Details
-
injectMembers
Injects dependencies into the fields and methods ofinstance
. Ignores the presence or absence of an injectable constructor.Whenever a
Component
creates an instance, it performs this injection automatically (after first performing constructor injection), so if you're able to let the component create all your objects for you, you'll never need to use this method.- Parameters:
instance
- into which members are to be injected- Throws:
NullPointerException
- ifinstance
isnull
-