|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||
@Qualifier @Retention(value=RUNTIME) public @interface Custom
Qualifier annotation used to annotate HK2 injections and
bindings for user custom providers. Providers are classes which implement one
of the provider interfaces (for example Message body reader interface).
Custom providers can be bound into the HK2 container using @Custom
annotation via org.glassfish.hk2.NamedBinder#annotatedWith(Class) method.
For example:
binderFactory.bind(MessageBodyReader.class).annotatedWith(Custom.class).toInstance(instanceOfMbr);
Once bound, the custom providers can be injected using @Custom qualifier
annotation again. For example:
@Custom
@Inject
MessageBodyReader messageBodyReader;
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT | |||||||||