Consistent UnsatisfiedDependencyException exposure with injection point metadata

Issue: SPR-13968
This commit is contained in:
Juergen Hoeller
2016-02-25 21:36:49 +01:00
parent 4c964473b1
commit b6dd8a9233
10 changed files with 428 additions and 188 deletions

View File

@@ -180,7 +180,14 @@ public class MethodParameter {
}
/**
* Returns the wrapped member.
* Return the class that declares the underlying Method or Constructor.
*/
public Class<?> getDeclaringClass() {
return getMember().getDeclaringClass();
}
/**
* Return the wrapped member.
* @return the Method or Constructor as Member
*/
public Member getMember() {
@@ -196,7 +203,9 @@ public class MethodParameter {
}
/**
* Returns the wrapped annotated element.
* Return the wrapped annotated element.
* <p>Note: This method exposes the annotations declared on the method/constructor
* itself (i.e. at the method/constructor level, not at the parameter level).
* @return the Method or Constructor as AnnotatedElement
*/
public AnnotatedElement getAnnotatedElement() {
@@ -211,13 +220,6 @@ public class MethodParameter {
}
}
/**
* Return the class that declares the underlying Method or Constructor.
*/
public Class<?> getDeclaringClass() {
return getMember().getDeclaringClass();
}
/**
* Return the index of the method/constructor parameter.
* @return the parameter index (-1 in case of the return type)
@@ -577,6 +579,12 @@ public class MethodParameter {
return (getMember().hashCode() * 31 + this.parameterIndex);
}
@Override
public String toString() {
return (this.method != null ? "method '" + this.method.getName() + "'" : "constructor") +
" parameter " + this.parameterIndex;
}
@Override
public MethodParameter clone() {
return new MethodParameter(this);