Package io.github.classgraph
Class AnnotationParameterValue
- java.lang.Object
-
- io.github.classgraph.AnnotationParameterValue
-
- All Implemented Interfaces:
HasName
,java.lang.Comparable<AnnotationParameterValue>
public class AnnotationParameterValue extends java.lang.Object implements HasName, java.lang.Comparable<AnnotationParameterValue>
A wrapper used to pair annotation parameter names with annotation parameter values.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class<?>
classRef
The class ref, once the class is loaded.protected ScanResult
scanResult
The scan result.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(AnnotationParameterValue other)
boolean
equals(java.lang.Object obj)
protected void
findReferencedClassInfo(java.util.Map<java.lang.String,ClassInfo> classNameToClassInfo, java.util.Set<ClassInfo> refdClassInfo)
GetClassInfo
objects for any classes referenced in the annotation parameters.protected ClassInfo
getClassInfo()
protected java.lang.String
getClassName()
The name of the class (used bygetClassInfo()
to fetch theClassInfo
object for the class).java.lang.String
getName()
Get the annotation parameter name.java.lang.Object
getValue()
Get the annotation parameter value.int
hashCode()
java.lang.String
toString()
-
-
-
Field Detail
-
scanResult
protected transient ScanResult scanResult
The scan result.
-
classRef
protected transient java.lang.Class<?> classRef
The class ref, once the class is loaded.
-
-
Method Detail
-
getName
public java.lang.String getName()
Get the annotation parameter name.
-
getValue
public java.lang.Object 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
protected java.lang.String getClassName()
The name of the class (used bygetClassInfo()
to fetch theClassInfo
object for the class).- Returns:
- The class name.
-
getClassInfo
protected ClassInfo getClassInfo()
-
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 annotation parameters.- Parameters:
classNameToClassInfo
- the map from class name toClassInfo
.refdClassInfo
- the referenced class info
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
compareTo
public int compareTo(AnnotationParameterValue other)
- Specified by:
compareTo
in interfacejava.lang.Comparable<AnnotationParameterValue>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-