Get a list of annotations on this method, along with any annotation parameter values.

@return a list of annotations on this method, along with any annotation parameter values, wrapped in
{@link AnnotationInfo} objects, or the empty list if none.
176334
public AnnotationInfoList getAnnotationInfo() {
        if (!scanResult.scanSpec.enableAnnotationInfo) {
            throw new IllegalArgumentException("Please call ClassGraph#enableAnnotationInfo() before #scan()");
        }
        return annotationInfo == null ? AnnotationInfoList.EMPTY_LIST
                : AnnotationInfoList.getIndirectAnnotations(annotationInfo, /* annotatedClass = */ null);
    }
908084
public List<AnnotationType<ElementType<T>>> getAllAnnotation()
   {
      List<AnnotationType<ElementType<T>>> list = new ArrayList<AnnotationType<ElementType<T>>>();
      List<Node> nodeList = childNode.get("annotation");
      for(Node node: nodeList)
      {
         AnnotationType<ElementType<T>>  type = new AnnotationTypeImpl<ElementType<T>>(this, "annotation", childNode, node);
         list.add(type);
      }
      return list;
   }
636902
@SuppressWarnings("unchecked")
	public List<MethodParameter> getParametersWith(Class<? extends Annotation> annotation) {

		Assert.notNull(annotation, "Annotation must not be null!");

		return parametersWithAnnotationCache.computeIfAbsent(annotation, key -> {

			return getParameters().stream()//
					.filter(it -> it.hasParameterAnnotation((Class<? extends Annotation>) key))//
					.collect(Collectors.toList());
		});
	}
718209
public ClassInfoList getAllAnnotations() {
        if (closed.get()) {
            throw new IllegalArgumentException("Cannot use a ScanResult after it has been closed");
        }
        if (!scanSpec.enableClassInfo || !scanSpec.enableAnnotationInfo) {
            throw new IllegalArgumentException(
                    "Please call ClassGraph#enableClassInfo() and #enableAnnotationInfo() before #scan()");
        }
        return ClassInfo.getAllAnnotationClasses(classNameToClassInfo.values(), scanSpec);
    }
124004
private static Set<Annotation> getAnnotations(final Annotation[] annotations, final Class<? extends Annotation> neededAnnotationType) {
        final Set<Annotation> ret = new HashSet<>();

        for (final Annotation annotation : annotations) {
            annotation.annotationType().getAnnotations();
            final Annotation[] metaAnnotations = annotation.annotationType().getAnnotations();
            for (final Annotation metaAnnotation : metaAnnotations) {
                if (metaAnnotation.annotationType().equals(neededAnnotationType)) {
                    ret.add(annotation);
                }
            }
        }

        return ret;
    }
1088114
public List<String> getAnnotations() {
        AnnotationBuilder result = new AnnotationBuilder();
        result.add( //
                getFixedLengthAnnotation(), //
                getLengthAnnotation(), //
                getNotNullAnnotation(), //
                getNotEmptyAnnotation(), //
                getCharPaddingAnnotation(), //
                getEmailAnnotation(), //
                getDigitsAnnotation(), //
                getSafeHtmlAnnotation(), //
                getUrlAnnotation());
        return result.getAnnotations();
    }
853307
def get_annotations(self):
        
        try:
            obj_list = self.__dict__['annotations']
            return [Annotation(i) for i in obj_list]
        except KeyError:
            self._lazy_load()
            obj_list = self.__dict__['annotations']
            return [Annotation(i) for i in obj_list]
1251148
public Set<Method> getMethodsWithAnyParamAnnotated(Annotation annotation) {
        return filter(getMethodsWithAnyParamAnnotated(annotation.annotationType()), withAnyParameterAnnotation(annotation));
    }
1036442
public static List<AnnotationInstance> createMethodAnnotationList(final MethodInfo method) {
        final List<AnnotationInstance> result = new ArrayList<>();
        for (AnnotationInstance ai : method.annotations()) {
            final AnnotationTarget at = ai.target();
            if (at.kind() == AnnotationTarget.Kind.METHOD) {
                result.add(ai);
            }
        }
        return result;
    }
335490
public List<MappedField> getFieldsAnnotatedWith(final Class<? extends Annotation> clazz) {
        final List<MappedField> results = new ArrayList<MappedField>();
        for (final MappedField mf : persistenceFields) {
            if (mf.hasAnnotation(clazz)) {
                results.add(mf);
            }
        }
        return results;
    }
858649
public final Method getMetaInfo() {
		for(Class<?> c=getClass(); c != null; c=c.getSuperclass()) {
			Method a = c.getAnnotation(Method.class);
			if(a != null) {
				return a;
			}
		}
		
		throw new IllegalArgumentException("Neither "+getClass()+" nor its superclasses are annotated with "+Method.class);
	}
959812
public Annotation[] getAnnotations(final Method method) throws AnnotationReadException {
        
        final Class<?> clazz = method.getDeclaringClass();
        
        if(xmlInfo != null && xmlInfo.containsClassInfo(clazz.getName())) {
            final ClassInfo classInfo = xmlInfo.getClassInfo(clazz.getName());
            
            if(classInfo.containsMethodInfo(method.getName())) {
                final MethodInfo methodInfo = classInfo.getMethodInfo(method.getName());
                final Map<String, Annotation> map = new HashMap<>();
                
                if(methodInfo.isOverride()) {
                    for(Annotation ann : method.getAnnotations()) {
                        map.put(ann.annotationType().getName(), ann);
                    }
                }
                
                for(AnnotationInfo annInfo: methodInfo.getAnnotationInfos()){
                    try {
                        map.put(annInfo.getClassName(),
                                annotationBuilder.buildAnnotation(Class.forName(annInfo.getClassName()), annInfo));
                    } catch (ClassNotFoundException e) {
                        throw new AnnotationReadException(String.format("not found class '%s'", annInfo.getClassName()), e);
                    }
                }
                
                return map.values().toArray(new Annotation[map.size()]);
            }
        }
        return method.getAnnotations();
    }
574128
private List<Map<Class<? extends Annotation>, ParameterInfo<?>>> createParametersInfos(Method method) {
    if (method.getParameterTypes().length <= 2) {
      return Collections.emptyList();
    }

    List<Map<Class<? extends Annotation>, ParameterInfo<?>>> result = new ArrayList<>();
    Type[] parameterTypes = method.getGenericParameterTypes();
    Annotation[][] parameterAnnotations = method.getParameterAnnotations();

    for (int i = 2; i < parameterAnnotations.length; i++) {
      Annotation[] annotations = parameterAnnotations[i];
      Map<Class<? extends Annotation>, ParameterInfo<?>> paramAnnotations = new IdentityHashMap<>();

      for (Annotation annotation : annotations) {
        Class<? extends Annotation> annotationType = annotation.annotationType();
        ParameterInfo<?> parameterInfo;

        if (PathParam.class.isAssignableFrom(annotationType)) {
          parameterInfo = ParameterInfo.create(annotation,
                                               ParamConvertUtils.createPathParamConverter(parameterTypes[i]));
        } else if (QueryParam.class.isAssignableFrom(annotationType)) {
          parameterInfo = ParameterInfo.create(annotation,
                                               ParamConvertUtils.createQueryParamConverter(parameterTypes[i]));
        } else if (HeaderParam.class.isAssignableFrom(annotationType)) {
          parameterInfo = ParameterInfo.create(annotation,
                                               ParamConvertUtils.createHeaderParamConverter(parameterTypes[i]));
        } else {
          parameterInfo = ParameterInfo.create(annotation, null);
        }

        paramAnnotations.put(annotationType, parameterInfo);
      }

      // Must have either @PathParam, @QueryParam or @HeaderParam, but not two or more.
      int presence = 0;
      for (Class<? extends Annotation> annotationClass : paramAnnotations.keySet()) {
        if (SUPPORTED_PARAM_ANNOTATIONS.contains(annotationClass)) {
          presence++;
        }
      }
      if (presence != 1) {
        throw new IllegalArgumentException(
          String.format("Must have exactly one annotation from %s for parameter %d in method %s",
                        SUPPORTED_PARAM_ANNOTATIONS, i, method));
      }

      result.add(Collections.unmodifiableMap(paramAnnotations));
    }

    return Collections.unmodifiableList(result);
  }
219675
@Override
    public List<AnnotationInfoImpl> getAnnotations() {
        if (annotations != null) {
            return annotations;
        }

        // Several cases where superclasses contribute no annotations.  In
        // each of these cases case, simply re-use the declared annotations
        // collection.
        //
        // (One case: All of the inheritable superclass annotations is
        // overridden by the immediate class, is not detected.)

        ClassInfoImpl useSuperClass = getSuperclass(); // Null for 'java.lang.Object'; null for interfaces.  
        if (useSuperClass == null) {
                annotations = declaredAnnotations;
            return annotations;
                    }

        // Retrieve *all* annotations of the superclass.  The effect
        // is to recurse across annotations of all superclasses.

        List<AnnotationInfoImpl> superAnnos = useSuperClass.getAnnotations();
        if (superAnnos.isEmpty()) {
            annotations = declaredAnnotations;
            return annotations;
                }

        Map<String, AnnotationInfoImpl> allAnnotations =
                        new HashMap<String, AnnotationInfoImpl>(superAnnos.size() + declaredAnnotations.size(), 1.0f);

        boolean sawInherited = false;
        for (AnnotationInfoImpl superAnno : superAnnos) {
            if (sawInherited = superAnno.isInherited()) {
                allAnnotations.put(superAnno.getAnnotationClassName(), superAnno);
            }
                }

        if (!sawInherited) {
            annotations = declaredAnnotations;
            return annotations;
        }

        // Make sure to add the declared annotations *after* adding the super class
        // annotations.  The immediate declared annotations have precedence.

        // We could test the number of overwritten annotations against the
        // number of inherited annotations.  That case seems infrequent, and
        // is not implemented.

        for (AnnotationInfoImpl declaredAnno : declaredAnnotations) {
            AnnotationInfoImpl overwrittenAnno = allAnnotations.put(declaredAnno.getAnnotationClassName(), declaredAnno);
            if (overwrittenAnno != null) {
                // NO-OP: But maybe we want to log this
            }
        }

        annotations = new ArrayList<AnnotationInfoImpl>(allAnnotations.values());
        return annotations;
    }
228108
public List<String> getNames() {
        if (this.isEmpty()) {
            return Collections.emptyList();
        } else {
            final List<String> names = new ArrayList<>(this.size());
            for (final T i : this) {
                names.add(i.getName());
            }
            return names;
        }
    }
152429
public final List<MethodInfo> getMethods() {
    List<MethodInfo> methodInfos = CollectUtils.newArrayList();
    for (Map.Entry<String, List<MethodInfo>> entry : methods.entrySet()) {
      for (MethodInfo info : entry.getValue())
        methodInfos.add(info);
    }
    Collections.sort(methodInfos);
    return methodInfos;
  }
8974
@com.fasterxml.jackson.annotation.JsonProperty("RequiredParameters")
    public java.util.List<String> getRequiredParameters() {
        return requiredParameters;
    }