Package io.github.classgraph
Class AnnotationInfo
- java.lang.Object
-
- io.github.classgraph.AnnotationInfo
-
- All Implemented Interfaces:
java.lang.Comparable<AnnotationInfo>
public class AnnotationInfo extends java.lang.Object implements java.lang.Comparable<AnnotationInfo>
Holds metadata about a specific annotation instance on a class, method, method parameter or field.
-
-
Field Summary
Fields Modifier and Type Field Description protected ScanResult
scanResult
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(AnnotationInfo o)
boolean
equals(java.lang.Object obj)
ClassInfo
getClassInfo()
protected java.lang.String
getClassName()
Return the name of the annotation class, forgetClassInfo()
.AnnotationParameterValueList
getDefaultParameterValues()
java.lang.String
getName()
AnnotationParameterValueList
getParameterValues()
int
hashCode()
boolean
isInherited()
java.lang.annotation.Annotation
loadClassAndInstantiate()
Load theAnnotation
class corresponding to thisAnnotationInfo
object, by callinggetClassInfo().loadClass()
, then create a new instance of the annotation, with the annotation parameter values obtained from thisAnnotationInfo
object.java.lang.String
toString()
-
-
-
Field Detail
-
scanResult
protected transient ScanResult scanResult
-
-
Method Detail
-
getName
public java.lang.String getName()
- Returns:
- The name of the annotation class.
-
isInherited
public boolean isInherited()
- Returns:
- true if this annotation is meta-annotated with
Inherited
.
-
getDefaultParameterValues
public AnnotationParameterValueList getDefaultParameterValues()
- Returns:
- the list of default parameter values for this annotation, or the empty list if none.
-
getParameterValues
public AnnotationParameterValueList getParameterValues()
- Returns:
- The parameter values of this annotation, including any default parameter values inherited from the annotation class definition, or the empty list if none.
-
getClassName
protected java.lang.String getClassName()
Return the name of the annotation class, forgetClassInfo()
.- Returns:
- The class name.
-
getClassInfo
public ClassInfo getClassInfo()
- Returns:
- The
ClassInfo
object for the annotation class.
-
loadClassAndInstantiate
public java.lang.annotation.Annotation loadClassAndInstantiate()
Load theAnnotation
class corresponding to thisAnnotationInfo
object, by callinggetClassInfo().loadClass()
, then create a new instance of the annotation, with the annotation parameter values obtained from thisAnnotationInfo
object.- Returns:
- The new
Annotation
instance.
-
compareTo
public int compareTo(AnnotationInfo o)
- Specified by:
compareTo
in interfacejava.lang.Comparable<AnnotationInfo>
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-