Interface InjectionResolver<T extends Annotation>
-
- Type Parameters:
T- This must be the annotation class of the injection annotation that this resolver will handle.
- All Known Subinterfaces:
ContextInjectionResolver
public interface InjectionResolver<T extends Annotation>This class allows users to provide a custom injection target for any annotation (including@Inject). The user would usually only provide a resolver for@Injectif it were specializing the system provided resolver for@Inject. Otherwise, this resolver can be used to provide injection points for any annotation.Jersey provides all
InjectionResolversfor JAX-RS annotation andorg.glassfish.jersey.server.Uriapart fromContextwhich must be implemented and registered directly as a part of DI integration because of many optimization which cannot be implemented on Jersey side.The
InjectionResolversare delivered to DI integration usingInjectionManager.register(Binder)and DI provider just filterInjectionResolverBindingand internally register the annotation handling using its own mechanism.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Class<T>getAnnotation()This method returns the annotation for what the injection resolver is implemented.booleanisConstructorParameterIndicator()This method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a constructor.booleanisMethodParameterIndicator()This method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a method.Objectresolve(Injectee injectee)This method will return the object that should be injected into the given injection point.
-
-
-
Method Detail
-
resolve
Object resolve(Injectee injectee)
This method will return the object that should be injected into the given injection point. It is the responsibility of the implementation to ensure that the object returned can be safely injected into the injection point.This method should not do the injection themselves.
- Parameters:
injectee- The injection point this value is being injected into- Returns:
- A possibly null value to be injected into the given injection point
-
isConstructorParameterIndicator
boolean isConstructorParameterIndicator()
This method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a constructor.- Returns:
- true if the injection annotation can appear in the parameter list of a constructor.
-
isMethodParameterIndicator
boolean isMethodParameterIndicator()
This method should return true if the annotation that indicates that this is an injection point can appear in the parameter list of a method.- Returns:
- true if the injection annotation can appear in the parameter list of a method.
-
-