Top Description Fields Constructors Methods
io.github.classgraph

public Class AnnotationParameterValueList

extends MappableInfoList<AnnotationParameterValue>
Class Inheritance
Imports
java.util.Collection, .Map, .Set, nonapi.io.github.classgraph.utils.LogNode

A list of AnnotationParameterValue objects.

Field Summary

Modifier and TypeField and Description
pack-priv static final AnnotationParameterValueList
private static final long

Constructor Summary

AccessConstructor and Description
public
AnnotationParameterValueList()

Construct a new modifiable empty list of AnnotationParameterValue objects.

public
AnnotationParameterValueList(final int
the size hint
sizeHint
)

Construct a new modifiable empty list of AnnotationParameterValue objects, given a size hint.

public
AnnotationParameterValueList(final Collection<AnnotationParameterValue>
the collection of AnnotationParameterValue objects.
annotationParameterValueCollection
)

Construct a new modifiable empty AnnotationParameterValueList, given an initial list of AnnotationParameterValue objects.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
convertWrapperArraysToPrimitiveArrays(final ClassInfo
the annotation class info
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).

public static AnnotationParameterValueList

Returns:

the unmodifiable empty AnnotationParameterValueList.
emptyList
()

Return an unmodifiable empty AnnotationParameterValueList.

protected void
findReferencedClassInfo(final Map<String, ClassInfo>
the map from class name to ClassInfo.
classNameToClassInfo
,
final Set<ClassInfo>
the referenced class info
refdClassInfo
,
final LogNode
the log
log
)

Get ClassInfo objects for any classes referenced in the methods in this list.

public Object

Returns:

The value of the AnnotationParameterValue object in the list with the given name, by calling AnnotationParameterValue#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
getValue
(final String
The name of an annotation parameter.
parameterName
)

Get the annotation parameter value, by calling AnnotationParameterValue#getValue() on the result of get(String), if non-null.

Inherited from io.github.classgraph.MappableInfoList:
asMapcontainsNameget

Field Detail

EMPTY_LISTback to summary
pack-priv static final AnnotationParameterValueList EMPTY_LIST

An unmodifiable empty AnnotationParameterValueList.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides io.github.classgraph.MappableInfoList.serialVersionUID.

serialVersionUID

Constructor Detail

AnnotationParameterValueListback to summary
public AnnotationParameterValueList()

Construct a new modifiable empty list of AnnotationParameterValue objects.

AnnotationParameterValueListback to summary
public AnnotationParameterValueList(final int sizeHint)

Construct a new modifiable empty list of AnnotationParameterValue objects, given a size hint.

Parameters
sizeHint:int

the size hint

AnnotationParameterValueListback to summary
public AnnotationParameterValueList(final Collection<AnnotationParameterValue> annotationParameterValueCollection)

Construct a new modifiable empty AnnotationParameterValueList, given an initial list of AnnotationParameterValue objects.

Parameters
annotationParameterValueCollection:Collection<AnnotationParameterValue>

the collection of AnnotationParameterValue objects.

Method Detail

convertWrapperArraysToPrimitiveArraysback to summary
pack-priv void convertWrapperArraysToPrimitiveArrays(final 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).

Parameters
annotationClassInfo:ClassInfo

the annotation class info

emptyListback to summary
public static AnnotationParameterValueList emptyList()

Return an unmodifiable empty AnnotationParameterValueList.

Returns:AnnotationParameterValueList

the unmodifiable empty AnnotationParameterValueList.

findReferencedClassInfoback to summary
protected void findReferencedClassInfo(final Map<String, ClassInfo> classNameToClassInfo, final Set<ClassInfo> refdClassInfo, final LogNode log)

Get ClassInfo objects for any classes referenced in the methods in this list.

Parameters
classNameToClassInfo:Map<String, ClassInfo>

the map from class name to ClassInfo.

refdClassInfo:Set<ClassInfo>

the referenced class info

log:LogNode

the log

getValueback to summary
public Object getValue(final String parameterName)

Get the annotation parameter value, by calling AnnotationParameterValue#getValue() on the result of get(String), if non-null.

Parameters
parameterName:String

The name of an annotation parameter.

Returns:Object

The value of the AnnotationParameterValue object in the list with the given name, by calling AnnotationParameterValue#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