Package org.jvnet.hk2.config
Class InjectionResolver<U extends Annotation>
java.lang.Object
org.jvnet.hk2.config.InjectionResolver<U>
- Type Parameters:
U- U is the annotation used to identify the injection targets.
- All Implemented Interfaces:
InjectionResolverQuery
public abstract class InjectionResolver<U extends Annotation>
extends Object
implements InjectionResolverQuery
Implementation of this abstract class are handling injection resolution
for a particular injection annotation
Injection targets are identified by the generic parameter and the constructor
of this class. Potential injection targets are fields and methods of the
injected type.
- Author:
- Jerome Dochez
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionInjectionResolver(Class<U> type) Construct a resolver with a particular injection type -
Method Summary
Modifier and TypeMethodDescriptiongetSetterMethod(Method annotated, U annotation) Returns the setter method responsible for setting the resource identified by the passed annotation on the passed annotated method.booleanisOptional(AnnotatedElement annotated, U annotation) Returns true if the resolution of this injection identified by the passed annotation instance is optionalMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jvnet.hk2.config.InjectionResolverQuery
getValue
-
Field Details
-
type
-
-
Constructor Details
-
InjectionResolver
Construct a resolver with a particular injection type- Parameters:
type- the injection annotation type
-
-
Method Details
-
getSetterMethod
Returns the setter method responsible for setting the resource identified by the passed annotation on the passed annotated method. This is useful when the annotation is specified on the getter for instance (due to external specification requirements for instance) while the setter should be used if values must be set using this injection resolver. By default, the setter method is the annotated method.- Parameters:
annotated- is the annotatedMethodannotation- the annotation on the method- Returns:
- the setter method to use for injecting the annotation identified resource
-
isOptional
Returns true if the resolution of this injection identified by the passed annotation instance is optional
-