public class InjectionPoint
extends java.lang.Object
UnsatisfiedDependencyException
.UnsatisfiedDependencyException.getInjectionPoint()
,
DependencyDescriptor
Modifier and Type | Field and Description |
---|---|
protected java.lang.reflect.Field |
field |
protected MethodParameter |
methodParameter |
Modifier | Constructor and Description |
---|---|
protected |
InjectionPoint()
Just available for serialization purposes in subclasses.
|
|
InjectionPoint(java.lang.reflect.Field field)
Create an injection point descriptor for a field.
|
protected |
InjectionPoint(InjectionPoint original)
Copy constructor.
|
|
InjectionPoint(MethodParameter methodParameter)
Create an injection point descriptor for a method or constructor parameter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
java.lang.reflect.AnnotatedElement |
getAnnotatedElement()
Return the wrapped annotated element.
|
<A extends java.lang.annotation.Annotation> |
getAnnotation(java.lang.Class<A> annotationType)
Retrieve a field/parameter annotation of the given type, if any.
|
java.lang.annotation.Annotation[] |
getAnnotations()
Obtain the annotations associated with the wrapped field or method/constructor parameter.
|
java.lang.Class<?> |
getDeclaredType()
Return the type declared by the underlying field or method/constructor parameter,
indicating the injection type.
|
java.lang.reflect.Field |
getField()
Return the wrapped Field, if any.
|
java.lang.reflect.Member |
getMember()
Returns the wrapped member, containing the injection point.
|
MethodParameter |
getMethodParameter()
Return the wrapped MethodParameter, if any.
|
int |
hashCode() |
protected MethodParameter |
obtainMethodParameter()
Return the wrapped MethodParameter, assuming it is present.
|
java.lang.String |
toString() |
@Nullable protected MethodParameter methodParameter
@Nullable protected java.lang.reflect.Field field
public InjectionPoint(MethodParameter methodParameter)
methodParameter
- the MethodParameter to wrappublic InjectionPoint(java.lang.reflect.Field field)
field
- the field to wrapprotected InjectionPoint(InjectionPoint original)
original
- the original descriptor to create a copy fromprotected InjectionPoint()
@Nullable public MethodParameter getMethodParameter()
Note: Either MethodParameter or Field is available.
null
if none@Nullable public java.lang.reflect.Field getField()
Note: Either MethodParameter or Field is available.
null
if noneprotected final MethodParameter obtainMethodParameter()
null
)java.lang.IllegalStateException
- if no MethodParameter is availablepublic java.lang.annotation.Annotation[] getAnnotations()
@Nullable public <A extends java.lang.annotation.Annotation> A getAnnotation(java.lang.Class<A> annotationType)
annotationType
- the annotation type to retrievenull
if none foundpublic java.lang.Class<?> getDeclaredType()
public java.lang.reflect.Member getMember()
public java.lang.reflect.AnnotatedElement getAnnotatedElement()
Note: In case of a method/constructor parameter, this exposes
the annotations declared on the method or constructor itself
(i.e. at the method/constructor level, not at the parameter level).
Use getAnnotations()
to obtain parameter-level annotations in
such a scenario, transparently with corresponding field annotations.
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object