This annotation serves is something of the Swiss Army knife for operations related to injection of dependencies into
an arbitrary method of Java Bean.
It marks parameters that should be injected in the IoC container, and it marks fields that should be injected inside
In terms of the IoC container; normally, resources take precedence over annotations when injecting. The Inject
annotation overrides this default, forcing the resolution of the parameters value via the master
, even when the parameter's type matches a type that is normally a
For service implementations, module classes, and other objects constructed via
, this annotation indicates that an injection is
desired on the field, as with fields of a Tapestry component.
In terms of the IoC container, the Inject annotation is only used on parameters to service builder methods (and
contributor and decorator methods) and on module class constructors. constructors. However, inside Tapestry
components (and only inside components
), it may be applied to fields. On fields that require injection, the
Inject annotation is required
Finally, on a constructor, this is used to indicate which
constructor should be used when more than one is