org.glassfish.jersey.internal.inject
Annotation Type Custom


@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;
 

Author:
Miroslav Fuksa (miroslav.fuksa at oracle.com)



Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.