public static Type getTargetType ( MethodParameter methodParam ) { Preconditions . checkNotNull ( methodParam , "MethodParameter must not be null" ) ; if ( methodParam . getConstructor ( ) != null ) { return methodParam . getConstructor ( ) . getGenericParameterTypes ( ) [ methodParam . getParameterIndex ( ) ] ; } else { if ( methodParam . getParameterIndex ( ) >= 0 ) { return methodParam . getMethod ( ) . getGenericParameterTypes ( ) [ methodParam . getParameterIndex ( ) ] ; } else { return methodParam . getMethod ( ) . getGenericReturnType ( ) ; } } }
Determine the target type for the given parameter specification .