private ClassInfoList getFieldOrMethodAnnotations(final RelType relType) {
        final boolean isField = relType == RelType.FIELD_ANNOTATIONS;
        if (!(isField ? scanResult.scanSpec.enableFieldInfo : scanResult.scanSpec.enableMethodInfo)
                || !scanResult.scanSpec.enableAnnotationInfo) {
            throw new IllegalArgumentException("Please call ClassGraph#enable" + (isField ? "Field" : "Method")
                    + "Info() and " + "#enableAnnotationInfo() before #scan()");
        }
        final ReachableAndDirectlyRelatedClasses fieldOrMethodAnnotations = this.filterClassInfo(relType,
                /* strictWhitelist = */ false, ClassType.ANNOTATION);
        final Set<ClassInfo> fieldOrMethodAnnotationsAndMetaAnnotations = new LinkedHashSet<>(
                fieldOrMethodAnnotations.reachableClasses);
        return new ClassInfoList(fieldOrMethodAnnotationsAndMetaAnnotations,
                fieldOrMethodAnnotations.directlyRelatedClasses, /* sortByName = */ true);
    }
private ClassInfoList getFieldOrMethodAnnotations ( final RelType relType ) { final boolean isField = relType == RelType . FIELD_ANNOTATIONS ; if ( ! ( isField ? scanResult . scanSpec . enableFieldInfo : scanResult . scanSpec . enableMethodInfo ) || ! scanResult . scanSpec . enableAnnotationInfo ) { throw new IllegalArgumentException ( "Please call ClassGraph#enable" + ( isField ? "Field" : "Method" ) + "Info() and " + "#enableAnnotationInfo() before #scan()" ) ; } final ReachableAndDirectlyRelatedClasses fieldOrMethodAnnotations = this . filterClassInfo ( relType , false , ClassType . ANNOTATION ) ; final Set < ClassInfo > fieldOrMethodAnnotationsAndMetaAnnotations = new LinkedHashSet < > ( fieldOrMethodAnnotations . reachableClasses ) ; return new ClassInfoList ( fieldOrMethodAnnotationsAndMetaAnnotations , fieldOrMethodAnnotations . directlyRelatedClasses , true ) ; }
Get the annotations or meta-annotations on fields, methods or method parametres declared by the class, (not
including fields, methods or method parameters declared by the interfaces or superclasses of this class).

@param relType
One of {@link RelType#FIELD_ANNOTATIONS}, {@link RelType#METHOD_ANNOTATIONS} or
{@link RelType#METHOD_PARAMETER_ANNOTATIONS}.
@return A list of annotations or meta-annotations on fields or methods declared by the class, (not including
fields or methods declared by the interfaces or superclasses of this class), as a list of
{@link ClassInfo} objects, or the empty list if none.