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