Package io.github.classgraph
Class AnnotationClassRef
java.lang.Object
io.github.classgraph.ScanResultObject
io.github.classgraph.AnnotationClassRef
Stores the type descriptor of a
Class<?>, as found in an annotation parameter value.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringThe class name.private StringThe type descriptor str.private TypeSignatureThe type signature.Fields inherited from class io.github.classgraph.ScanResultObject
classRef, scanResult -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanGet the class info.protected StringThe name of the class (used byScanResultObject.getClassInfo()to fetch theClassInfoobject for the class).getName()Get the name of the referenced class.private TypeSignatureGet the type signature.inthashCode()Class<?> Loads the referenced class, returning aClass<?>reference for the referenced class.Class<?> loadClass(boolean ignoreExceptions) Loads the referenced class, returning aClass<?>reference for the referenced class.(package private) voidsetScanResult(ScanResult scanResult) Set ScanResult backreferences in info objects after scan has completed.protected voidtoString(boolean useSimpleNames, StringBuilder buf) Render to string.Methods inherited from class io.github.classgraph.ScanResultObject
findReferencedClassInfo, findReferencedClassInfo, loadClass, loadClass, toString, toString, toStringWithSimpleNames
-
Field Details
-
typeDescriptorStr
The type descriptor str. -
typeSignature
The type signature. -
className
The class name.
-
-
Constructor Details
-
AnnotationClassRef
AnnotationClassRef()Constructor. -
AnnotationClassRef
AnnotationClassRef(String typeDescriptorStr) Constructor.- Parameters:
typeDescriptorStr- the type descriptor str
-
-
Method Details
-
getName
Get the name of the referenced class.- Returns:
- The name of the referenced class.
-
getTypeSignature
Get the type signature.- Returns:
- The type signature of the
Class<?>reference. This will be aClassRefTypeSignature, aBaseTypeSignature, or anArrayTypeSignature.
-
loadClass
Loads the referenced class, returning aClass<?>reference for the referenced class.- Overrides:
loadClassin classScanResultObject- Parameters:
ignoreExceptions- if true, ignore exceptions and instead return null if the class could not be loaded.- Returns:
- The
Class<?>reference for the referenced class. - Throws:
IllegalArgumentException- if the class could not be loaded and ignoreExceptions was false.
-
loadClass
Loads the referenced class, returning aClass<?>reference for the referenced class.- Overrides:
loadClassin classScanResultObject- Returns:
- The
Class<?>reference for the referenced class. - Throws:
IllegalArgumentException- if the class could not be loaded.
-
getClassName
Description copied from class:ScanResultObjectThe name of the class (used byScanResultObject.getClassInfo()to fetch theClassInfoobject for the class).- Specified by:
getClassNamein classScanResultObject- Returns:
- The class name.
-
getClassInfo
Get the class info.- Overrides:
getClassInfoin classScanResultObject- Returns:
- The
ClassInfoobject for the referenced class, or null if the referenced class was not encountered during scanning (i.e. if no ClassInfo object was created for the class during scanning). N.B. even if this method returns null,loadClass()may be able to load the referenced class by name.
-
setScanResult
Description copied from class:ScanResultObjectSet ScanResult backreferences in info objects after scan has completed.- Overrides:
setScanResultin classScanResultObject- Parameters:
scanResult- the scan result
-
hashCode
public int hashCode() -
equals
-
toString
Description copied from class:ScanResultObjectRender to string.- Specified by:
toStringin classScanResultObject- Parameters:
useSimpleNames- if true, use just the simple name of each class.buf- the buf
-