Annotation Type Self


This annotation is placed on an injection point that is to be injected with the ActiveDescriptor that was used to create the instance.

The following things must be true of injection points annotated with Self

  • The injection point must have the type ActiveDescriptor. The generic type is ignored
  • The injection point must have no qualifiers
  • The injection point must not be annotated Optional
  • The class must not be getting injected with the ServiceLocator.inject(Object) method
Furthermore, the ActiveDescriptor that can be injected have the following restrictions: A valid injection point that is annotated with Self will not go through the normal resolution process, and hence cannot be customized.