Class AnnotationParameterValue
java.lang.Object
io.github.classgraph.AnnotationParameterValue
- All Implemented Interfaces:
HasName, Comparable<AnnotationParameterValue>
public class AnnotationParameterValue
extends Object
implements HasName, Comparable<AnnotationParameterValue>
A wrapper used to pair annotation parameter names with annotation parameter values.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Class<?> The class ref, once the class is loaded.protected ScanResultThe scan result. -
Method Summary
Modifier and TypeMethodDescriptionintbooleanprotected voidfindReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, nonapi.io.github.classgraph.utils.LogNode log) GetClassInfoobjects for any classes referenced in the annotation parameters.protected ClassInfoprotected StringThe name of the class (used byScanResultObject.getClassInfo()to fetch theClassInfoobject for the class).getName()Get the annotation parameter name.getValue()Get the annotation parameter value.inthashCode()toString()Render to string.protected voidtoString(boolean useSimpleNames, StringBuilder buf) Render to string.Render to string, using only simple names for classes.
-
Field Details
-
scanResult
The scan result. -
classRef
The class ref, once the class is loaded.
-
-
Method Details
-
getName
-
getValue
Get the annotation parameter value.- Returns:
- 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
-
getClassName
-
getClassInfo
-
findReferencedClassInfo
protected void findReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, nonapi.io.github.classgraph.utils.LogNode log) GetClassInfoobjects for any classes referenced in the annotation parameters.- Parameters:
classNameToClassInfo- the map from class name toClassInfo.refdClassInfo- the referenced class infolog- the log
-
compareTo
- Specified by:
compareToin interfaceComparable<AnnotationParameterValue>
-
equals
-
hashCode
-
toString
Render to string.- Parameters:
useSimpleNames- if true, use just the simple name of each class.buf- the buf
-
toStringWithSimpleNames
Render to string, using only simple names for classes.- Returns:
- the string representation, using simple names for classes.
-
toString
-