@Target(value={METHOD,CONSTRUCTOR,FIELD})
@Retention(value=RUNTIME)
@Documented
public @interface Inject
Injector should inject values.
The Injector fulfills injection requests for:
@Inject or must have a
constructor taking no parameters. The Injector then proceeds to perform
method and field injections.
Injector.injectMembers(java.lang.Object),
LinkedBindingBuilder.toInstance(Object) and
LinkedBindingBuilder.toProvider(Provider).
In this case all constructors are, of course, ignored.
Module has
specifically requested static injection for, using
Binder.requestStaticInjection(java.lang.Class<?>...).
In all cases, a member can be injected regardless of its Java access specifier (private, default, protected, public).
| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
optional
If true, and the appropriate binding is not found,
the Injector will skip injection of this method or field rather than
produce an error.
|
public abstract boolean optional