Package io.github.classgraph
Class AnnotationParameterValueList
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<T>
-
- io.github.classgraph.InfoList<T>
-
- io.github.classgraph.MappableInfoList<AnnotationParameterValue>
-
- io.github.classgraph.AnnotationParameterValueList
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<AnnotationParameterValue>
,java.util.Collection<AnnotationParameterValue>
,java.util.List<AnnotationParameterValue>
,java.util.RandomAccess
public class AnnotationParameterValueList extends MappableInfoList<AnnotationParameterValue>
A list ofAnnotationParameterValue
objects.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AnnotationParameterValueList()
Construct a new modifiable empty list ofAnnotationParameterValue
objects.AnnotationParameterValueList(int sizeHint)
Construct a new modifiable empty list ofAnnotationParameterValue
objects, given a size hint.AnnotationParameterValueList(java.util.Collection<AnnotationParameterValue> annotationParameterValueCollection)
Construct a new modifiable emptyAnnotationParameterValueList
, given an initial list ofAnnotationParameterValue
objects.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(int index, T element)
boolean
add(T element)
boolean
addAll(int index, java.util.Collection<? extends T> c)
boolean
addAll(java.util.Collection<? extends T> c)
void
clear()
static AnnotationParameterValueList
emptyList()
Return an unmodifiable emptyAnnotationParameterValueList
.protected void
findReferencedClassInfo(java.util.Map<java.lang.String,ClassInfo> classNameToClassInfo, java.util.Set<ClassInfo> refdClassInfo)
GetClassInfo
objects for any classes referenced in the methods in this list.java.lang.Object
getValue(java.lang.String parameterName)
Get the annotation parameter value, by callingAnnotationParameterValue.getValue()
on the result ofMappableInfoList.get(String)
, if non-null.java.util.Iterator<T>
iterator()
java.util.ListIterator<T>
listIterator()
T
remove(int index)
boolean
remove(java.lang.Object o)
boolean
removeAll(java.util.Collection<?> c)
boolean
retainAll(java.util.Collection<?> c)
T
set(int index, T element)
-
Methods inherited from class io.github.classgraph.MappableInfoList
asMap, containsName, get
-
Methods inherited from class io.github.classgraph.InfoList
equals, getAsStrings, getNames, hashCode
-
Methods inherited from class java.util.ArrayList
clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, lastIndexOf, listIterator, removeIf, removeRange, replaceAll, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Constructor Detail
-
AnnotationParameterValueList
public AnnotationParameterValueList()
Construct a new modifiable empty list ofAnnotationParameterValue
objects.
-
AnnotationParameterValueList
public AnnotationParameterValueList(int sizeHint)
Construct a new modifiable empty list ofAnnotationParameterValue
objects, given a size hint.- Parameters:
sizeHint
- the size hint
-
AnnotationParameterValueList
public AnnotationParameterValueList(java.util.Collection<AnnotationParameterValue> annotationParameterValueCollection)
Construct a new modifiable emptyAnnotationParameterValueList
, given an initial list ofAnnotationParameterValue
objects.- Parameters:
annotationParameterValueCollection
- the collection ofAnnotationParameterValue
objects.
-
-
Method Detail
-
emptyList
public static AnnotationParameterValueList emptyList()
Return an unmodifiable emptyAnnotationParameterValueList
.- Returns:
- the unmodifiable empty
AnnotationParameterValueList
.
-
findReferencedClassInfo
protected void findReferencedClassInfo(java.util.Map<java.lang.String,ClassInfo> classNameToClassInfo, java.util.Set<ClassInfo> refdClassInfo)
GetClassInfo
objects for any classes referenced in the methods in this list.- Parameters:
classNameToClassInfo
- the map from class name toClassInfo
.refdClassInfo
- the referenced class info
-
getValue
public java.lang.Object getValue(java.lang.String parameterName)
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
AnnotationParameterValue
object 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
-
add
public boolean add(T element)
- Specified by:
add
in interfacejava.util.Collection<T>
- Specified by:
add
in interfacejava.util.List<T>
- Overrides:
add
in classjava.util.ArrayList<T>
-
add
public void add(int index, T element)
- Specified by:
add
in interfacejava.util.List<T>
- Overrides:
add
in classjava.util.ArrayList<T>
-
remove
public boolean remove(java.lang.Object o)
- Specified by:
remove
in interfacejava.util.Collection<T>
- Specified by:
remove
in interfacejava.util.List<T>
- Overrides:
remove
in classjava.util.ArrayList<T>
-
remove
public T remove(int index)
- Specified by:
remove
in interfacejava.util.List<T>
- Overrides:
remove
in classjava.util.ArrayList<T>
-
addAll
public boolean addAll(java.util.Collection<? extends T> c)
- Specified by:
addAll
in interfacejava.util.Collection<T>
- Specified by:
addAll
in interfacejava.util.List<T>
- Overrides:
addAll
in classjava.util.ArrayList<T>
-
addAll
public boolean addAll(int index, java.util.Collection<? extends T> c)
- Specified by:
addAll
in interfacejava.util.List<T>
- Overrides:
addAll
in classjava.util.ArrayList<T>
-
removeAll
public boolean removeAll(java.util.Collection<?> c)
- Specified by:
removeAll
in interfacejava.util.Collection<T>
- Specified by:
removeAll
in interfacejava.util.List<T>
- Overrides:
removeAll
in classjava.util.ArrayList<T>
-
retainAll
public boolean retainAll(java.util.Collection<?> c)
- Specified by:
retainAll
in interfacejava.util.Collection<T>
- Specified by:
retainAll
in interfacejava.util.List<T>
- Overrides:
retainAll
in classjava.util.ArrayList<T>
-
clear
public void clear()
- Specified by:
clear
in interfacejava.util.Collection<T>
- Specified by:
clear
in interfacejava.util.List<T>
- Overrides:
clear
in classjava.util.ArrayList<T>
-
set
public T set(int index, T element)
- Specified by:
set
in interfacejava.util.List<T>
- Overrides:
set
in classjava.util.ArrayList<T>
-
iterator
public java.util.Iterator<T> iterator()
- Specified by:
iterator
in interfacejava.util.Collection<T>
- Specified by:
iterator
in interfacejava.lang.Iterable<T>
- Specified by:
iterator
in interfacejava.util.List<T>
- Overrides:
iterator
in classjava.util.ArrayList<T>
-
listIterator
public java.util.ListIterator<T> listIterator()
- Specified by:
listIterator
in interfacejava.util.List<T>
- Overrides:
listIterator
in classjava.util.ArrayList<T>
-
-