public abstract @interface

Inject

implements Annotation
com.google.inject.Inject

Class Overview

Annotates members of your implementation class (constructors, methods and fields) into which the Injector should inject values. The Injector fulfills injection requests for:

  • Every instance it constructs. The class being constructed must have exactly one of its constructors marked with @Inject or must have a constructor taking no parameters. The Injector then proceeds to perform method and field injections.
  • Pre-constructed instances passed to injectMembers(Object), toInstance(Object) and toProvider(Provider). In this case all constructors are, of course, ignored.
  • Static fields and methods of classes which any Module has specifically requested static injection for, using requestStaticInjection(Class...).
In all cases, a member can be injected regardless of its Java access specifier (private, default, protected, public).

Summary

[Expand]
Inherited Methods
From interface java.lang.annotation.Annotation