Package org.glassfish.hk2.api
Annotation Type Self
-
@Documented @Retention(RUNTIME) @Target({FIELD,PARAMETER}) public @interface Self
This annotation is placed on an injection point that is to be injected with theActiveDescriptor
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
ActiveDescriptor
that can be injected have the following restrictions:- The
ActiveDescriptor
was not pre-reified prior to being bound (i.e. third-party ActiveDescriptors) - The
ActiveDescriptor
is not aDescriptorType.PROVIDE_METHOD
Self
will not go through the normal resolution process, and hence cannot be customized. - The injection point must have the type