|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Target(value={PARAMETER,FIELD})
@Retention(value=RUNTIME)
@Documented
public @interface InjectThis annotation serves two similar purposes: it marks parameters that should be injected in the IoC container, and it marks fields that should be injected inside Tapestry components.
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 masterObjectProvider, even when the parameter's type matches a type that
is normally a resource. This is most often used in conjunction with Value annotation when
injecting a string, as normally, the String would be matched as the service id.
In terms of the IoC container, the Inject annotation is only used on parameters to service
builder methods and 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.
ObjectProvider
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||