jersey2-guice-impl/src/main/java/com/squarespace/jersey2/guice/BindingUtils.java
private static Annotation getBindingAnnotation(AnnotatedElement element, int position) {
    if (element instanceof Field) {
      return getBindingAnnotation(((Field)element).getAnnotations());
    }
    
    if (element instanceof Method) {
      Annotation annotations[][] = ((Method)element).getParameterAnnotations();
      return getBindingAnnotation(annotations[position]);
    }
    
    if (element instanceof Constructor<?>) {
      Annotation annotations[][] = ((Constructor<?>)element).getParameterAnnotations();
      return getBindingAnnotation(annotations[position]);
    }
    
    return null;
  }
private static Annotation getBindingAnnotation(AnnotatedElement element, int position) {
    if (element instanceof Field) {
      return getBindingAnnotation(((Field)element).getAnnotations());
    }
    
    if (element instanceof Method) {
      Annotation annotations[][] = ((Method)element).getParameterAnnotations();
      return getBindingAnnotation(annotations[position]);
    }
    
    if (element instanceof Constructor<?>) {
      Annotation annotations[][] = ((Constructor<?>)element).getParameterAnnotations();
      return getBindingAnnotation(annotations[position]);
    }
    
    return null;
  }
Returns a {@link BindingAnnotation} for the given {@link AnnotatedElement} and position.