Package io.github.classgraph
Class AnnotationParameterValueList
java.lang.Object
java.util.AbstractCollection<AnnotationParameterValue>
java.util.AbstractList<AnnotationParameterValue>
java.util.ArrayList<AnnotationParameterValue>
io.github.classgraph.PotentiallyUnmodifiableList<AnnotationParameterValue>
io.github.classgraph.InfoList<AnnotationParameterValue>
io.github.classgraph.MappableInfoList<AnnotationParameterValue>
io.github.classgraph.AnnotationParameterValueList
- All Implemented Interfaces:
Serializable,Cloneable,Iterable<AnnotationParameterValue>,Collection<AnnotationParameterValue>,List<AnnotationParameterValue>,RandomAccess,SequencedCollection<AnnotationParameterValue>
A list of
AnnotationParameterValue objects.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final AnnotationParameterValueListAn unmodifiable emptyAnnotationParameterValueList.private static final longserialVersionUIDFields inherited from class io.github.classgraph.PotentiallyUnmodifiableList
modifiableFields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionConstruct a new modifiable empty list ofAnnotationParameterValueobjects.AnnotationParameterValueList(int sizeHint) Construct a new modifiable empty list ofAnnotationParameterValueobjects, given a size hint.AnnotationParameterValueList(Collection<AnnotationParameterValue> annotationParameterValueCollection) Construct a new modifiable emptyAnnotationParameterValueList, given an initial list ofAnnotationParameterValueobjects. -
Method Summary
Modifier and TypeMethodDescription(package private) voidconvertWrapperArraysToPrimitiveArrays(ClassInfo annotationClassInfo) For primitive array type params, replace Object[] arrays containing boxed types with primitive arrays (need to check the type of each method of the annotation class to determine if it is a primitive array type).static AnnotationParameterValueListReturn an unmodifiable emptyAnnotationParameterValueList.protected voidfindReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, LogNode log) GetClassInfoobjects for any classes referenced in the methods in this list.Get the annotation parameter value, by callingAnnotationParameterValue.getValue()on the result ofMappableInfoList.get(String), if non-null.Methods inherited from class io.github.classgraph.MappableInfoList
asMap, containsName, getMethods inherited from class io.github.classgraph.InfoList
equals, getAsStrings, getAsStringsWithSimpleNames, getNames, hashCodeMethods inherited from class io.github.classgraph.PotentiallyUnmodifiableList
add, add, addAll, addAll, clear, iterator, listIterator, makeUnmodifiable, remove, remove, removeAll, retainAll, setMethods inherited from class java.util.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 java.util.AbstractCollection
containsAll, toStringMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, stream, toArrayMethods inherited from interface java.util.List
containsAll, reversed
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDserialVersionUID- See Also:
-
EMPTY_LIST
An unmodifiable emptyAnnotationParameterValueList.
-
-
Constructor Details
-
AnnotationParameterValueList
public AnnotationParameterValueList()Construct a new modifiable empty list ofAnnotationParameterValueobjects. -
AnnotationParameterValueList
public AnnotationParameterValueList(int sizeHint) Construct a new modifiable empty list ofAnnotationParameterValueobjects, given a size hint.- Parameters:
sizeHint- the size hint
-
AnnotationParameterValueList
public AnnotationParameterValueList(Collection<AnnotationParameterValue> annotationParameterValueCollection) Construct a new modifiable emptyAnnotationParameterValueList, given an initial list ofAnnotationParameterValueobjects.- Parameters:
annotationParameterValueCollection- the collection ofAnnotationParameterValueobjects.
-
-
Method Details
-
emptyList
Return an unmodifiable emptyAnnotationParameterValueList.- Returns:
- the unmodifiable empty
AnnotationParameterValueList.
-
findReferencedClassInfo
protected void findReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, LogNode log) GetClassInfoobjects for any classes referenced in the methods in this list.- Parameters:
classNameToClassInfo- the map from class name toClassInfo.refdClassInfo- the referenced class infolog- the log
-
convertWrapperArraysToPrimitiveArrays
For primitive array type params, replace Object[] arrays containing boxed types with primitive arrays (need to check the type of each method of the annotation class to determine if it is a primitive array type).- Parameters:
annotationClassInfo- the annotation class info
-
getValue
Get the annotation parameter value, by callingAnnotationParameterValue.getValue()on the result ofMappableInfoList.get(String), if non-null.- Parameters:
parameterName- The name of an annotation parameter.- Returns:
- The value of the
AnnotationParameterValueobject in the list with the given name, by callingAnnotationParameterValue.getValue()on that object, or null if not found.The annotation parameter value may be one of the following types:
- String for string constants
- String[] for arrays of strings
- A boxed type, e.g. Integer or Character, for primitive-typed constants
- A 1-dimensional primitive-typed array (i.e. int[], long[], short[], char[], byte[], boolean[], float[], or double[]), for arrays of primitives
- A 1-dimensional
Object[] array for array types (and then the array element type may be one of the types in this list) AnnotationEnumValue, for enum constants (this wraps the enum class and the string name of the constant)AnnotationClassRef, for Class references within annotations (this wraps the name of the referenced class)AnnotationInfo, for nested annotations
-