Class AnnotationInfoList
java.lang.Object
- All Implemented Interfaces:
Serializable, Cloneable, Iterable<AnnotationInfo>, Collection<AnnotationInfo>, List<AnnotationInfo>, RandomAccess, SequencedCollection<AnnotationInfo>
A list of
AnnotationInfo objects.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceFilter anAnnotationInfoListusing a predicate mapping anAnnotationInfoobject to a boolean, producing anotherAnnotationInfoListfor all items in the list for which the predicate is true. -
Field Summary
Fields inherited from class AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new modifiable empty list ofAnnotationInfoobjects.AnnotationInfoList(int sizeHint) Construct a new modifiable empty list ofAnnotationInfoobjects, given a size hint.AnnotationInfoList(AnnotationInfoList reachableAnnotations) Construct a new modifiable emptyAnnotationInfoList, given an initial list ofAnnotationInfoobjects. -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(int index, AnnotationInfo element) booleanadd(AnnotationInfo element) booleanaddAll(int index, Collection<? extends AnnotationInfo> c) booleanaddAll(Collection<? extends AnnotationInfo> c) voidclear()returns the list of direct annotations, excluding meta-annotations.static AnnotationInfoListReturn an unmodifiable emptyAnnotationInfoList.booleanFind the subset of theAnnotationInfoobjects in this list for which the given filter predicate is true.protected voidfindReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, nonapi.io.github.classgraph.utils.LogNode log) GetClassInfoobjects for any classes referenced in this list.getRepeatable(Class<? extends Annotation> annotationClass) Get theRepeatableannotation with the given class, or the empty list if none found.getRepeatable(String name) Get theRepeatableannotation with the given name, or the empty list if none found.inthashCode()iterator()remove(int index) booleanbooleanremoveAll(Collection<?> c) booleanretainAll(Collection<?> c) set(int index, AnnotationInfo element) Methods inherited from class MappableInfoList
asMap, containsName, getMethods inherited from class InfoList
getAsStrings, getAsStringsWithSimpleNames, getNamesMethods inherited from class ArrayList
addFirst, addLast, clone, contains, ensureCapacity, forEach, get, getFirst, getLast, indexOf, isEmpty, lastIndexOf, listIterator, removeFirst, removeIf, removeLast, removeRange, replaceAll, size, sort, spliterator, subList, toArray, toArray, trimToSizeMethods inherited from class AbstractCollection
containsAll, toStringMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface List
containsAll, reversed
-
Constructor Details
-
AnnotationInfoList
public AnnotationInfoList()Construct a new modifiable empty list ofAnnotationInfoobjects. -
AnnotationInfoList
public AnnotationInfoList(int sizeHint) Construct a new modifiable empty list ofAnnotationInfoobjects, given a size hint.- Parameters:
sizeHint- the size hint
-
AnnotationInfoList
Construct a new modifiable emptyAnnotationInfoList, given an initial list ofAnnotationInfoobjects.- Parameters:
reachableAnnotations- the reachable annotations
-
-
Method Details
-
emptyList
Return an unmodifiable emptyAnnotationInfoList.- Returns:
- the unmodifiable empty
AnnotationInfoList.
-
filter
Find the subset of theAnnotationInfoobjects in this list for which the given filter predicate is true.- Parameters:
filter- TheAnnotationInfoList.AnnotationInfoFilterto apply.- Returns:
- The subset of the
AnnotationInfoobjects in this list for which the given filter predicate is true.
-
findReferencedClassInfo
protected void findReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, nonapi.io.github.classgraph.utils.LogNode log) GetClassInfoobjects for any classes referenced in this list.- Parameters:
classNameToClassInfo- the map from class name toClassInfo.refdClassInfo- the referenced class infolog- the log
-
directOnly
returns the list of direct annotations, excluding meta-annotations. If thisAnnotationInfoListconsists of class annotations, i.e. if it was produced using `ClassInfo#getAnnotationInfo()`, then the returned list also excludes annotations inherited from a superclass or implemented interface that was meta-annotated with@Inherited.- Returns:
- The list of directly-related annotations.
-
getRepeatable
Get theRepeatableannotation with the given class, or the empty list if none found.- Parameters:
annotationClass- The class to search for.- Returns:
- The list of annotations with the given class, or the empty list if none found.
-
getRepeatable
Get theRepeatableannotation with the given name, or the empty list if none found.- Parameters:
name- The name to search for.- Returns:
- The list of annotations with the given name, or the empty list if none found.
-
equals
- Specified by:
equalsin interfaceCollection<AnnotationInfo>- Specified by:
equalsin interfaceList<AnnotationInfo>- Overrides:
equalsin classInfoList<AnnotationInfo>
-
hashCode
public int hashCode()- Specified by:
hashCodein interfaceCollection<AnnotationInfo>- Specified by:
hashCodein interfaceList<AnnotationInfo>- Overrides:
hashCodein classInfoList<AnnotationInfo>
-
add
-
add
-
remove
-
remove
-
addAll
-
addAll
-
removeAll
-
retainAll
-
clear
-
set
-
iterator
-
listIterator
- Specified by:
listIteratorin interfaceList<T>- Overrides:
listIteratorin classArrayList<T>
-