|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.hk2.component.InjectionResolver<U>
U - U is the annotation used to identify the injection targets.public abstract class InjectionResolver<U extends java.lang.annotation.Annotation>
Implementation of this abstract class are handling injection resolution
for a particular injection annotation Inject
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.
| Field Summary | |
|---|---|
java.lang.Class<U> |
type
|
| Constructor Summary | |
|---|---|
InjectionResolver(java.lang.Class<U> type)
Construct a resolver with a particular injection type |
|
| Method Summary | ||
|---|---|---|
java.lang.reflect.Method |
getSetterMethod(java.lang.reflect.Method annotated,
U annotation)
Returns the setter method responsible for setting the resource identified by the passed annotation on the passed annotated method. |
|
abstract
|
getValue(java.lang.Object component,
Inhabitant<?> onBehalfOf,
java.lang.reflect.AnnotatedElement annotated,
java.lang.reflect.Type genericType,
java.lang.Class<V> type)
Returns the value to inject in the field or method of component annotated with the annotated annotation. |
|
boolean |
isOptional(java.lang.reflect.AnnotatedElement annotated,
U annotation)
Returns true if the resolution of this injection identified by the passed annotation instance is optional |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public final java.lang.Class<U extends java.lang.annotation.Annotation> type
| Constructor Detail |
|---|
public InjectionResolver(java.lang.Class<U> type)
type - the injection annotation type| Method Detail |
|---|
public java.lang.reflect.Method getSetterMethod(java.lang.reflect.Method annotated,
U annotation)
annotated - is the annotated Methodannotation - the annotation on the method
public boolean isOptional(java.lang.reflect.AnnotatedElement annotated,
U annotation)
annotated - is the annotated java element Method
or Fieldannotation - the injection metadata
getValue() can return null without generating a
faulty injection operation
public abstract <V> V getValue(java.lang.Object component,
Inhabitant<?> onBehalfOf,
java.lang.reflect.AnnotatedElement annotated,
java.lang.reflect.Type genericType,
java.lang.Class<V> type)
throws ComponentException
component - injection target instanceonBehalfOf - inhabitant doing the injection forannotated - is the annotated java element Method
or FieldgenericType - the generic type of the expected returntype - type of the expected return
ComponentException - if the resource cannot be located.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||