code: public static <A extends Annotation> List<A> getMethodParameterAnnotations(Method method, int index,
          Class<A> annotationClass, boolean inherits)
      {
          List<A> annotations = getMethodParameterAnnotations(method, index, annotationClass);
  
          if (inherits && annotationClass.getAnnotation(Inherited.class) != null) {
              Class<?>[] ifaces = method.getDeclaringClass().getInterfaces();
  
              for (Class<?> iface : ifaces) {
                  Method interfaceMethod;
                  try {
                      interfaceMethod = iface.getMethod(method.getName(), method.getParameterTypes());
  
                      if (interfaceMethod != null) {
                          annotations
                              .addAll(getMethodParameterAnnotations(interfaceMethod, index, annotationClass, true));
                      }
                  } catch (Exception e) {
                      // Ignore it
                  }
              }
  
              Class<?> superClass = method.getDeclaringClass().getSuperclass();
              if (superClass != null) {
                  try {
                      Method superMethod = superClass.getMethod(method.getName(), method.getParameterTypes());
  
                      if (superMethod != null) {
                          annotations.addAll(getMethodParameterAnnotations(superMethod, index, annotationClass, true));
                      }
                  } catch (Exception e) {
                      // Ignore it
                  }
              }
          }
  
          return annotations;
      }
docs: Get {@link Annotation}s of the provided class associated to the the provided method parameter.
  
  @param <A> the actual {@link Annotation} type
  @param method the method
  @param index the index of the parameter in the method
  @param annotationClass the class of the annotation
  @param inherits if true also search on overwritten methods from interfaces and super classes
  @return the annotations