Expression argument = arguments.next(); annotations = method.getParameterAnnotations(i); for (ResolvedAnnotation annotation : annotations) { annotation = getRelevantAnnotation(annotation);
/** * Searches for the annotation of the given type on the method * * @param type the fully qualified name of the annotation to check * @param parameterIndex the index of the parameter to look up * @return the annotation, or null if not found */ @Nullable public ResolvedAnnotation getParameterAnnotation(@NonNull String type, int parameterIndex) { for (ResolvedAnnotation annotation : getParameterAnnotations(parameterIndex)) { if (annotation.getType().matchesSignature(type)) { return annotation; } } return null; }