Class AnnotationClassRef
java.lang.Object
io.github.classgraph.AnnotationClassRef
Stores the type descriptor of a
Class<?>, as found in an annotation parameter value.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Class<?> The class ref, once the class is loaded.protected ScanResultThe scan result. -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected voidfindReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, nonapi.io.github.classgraph.utils.LogNode log) GetClassInfoobjects for any classes referenced by this object.Get 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.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.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
Get the name of the referenced class.- Returns:
- The name of the referenced class.
-
loadClass
Loads the referenced class, returning aClass<?>reference for the referenced class.- 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.- Returns:
- The
Class<?>reference for the referenced class. - Throws:
IllegalArgumentException- if the class could not be loaded.
-
getClassName
-
getClassInfo
Get the class info.- 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.
-
hashCode
-
equals
-
toString
Render to string.- Parameters:
useSimpleNames- if true, use just the simple name of each class.buf- the buf
-
findReferencedClassInfo
protected void findReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, nonapi.io.github.classgraph.utils.LogNode log) GetClassInfoobjects for any classes referenced by this object.- Parameters:
classNameToClassInfo- the map from class name toClassInfo.refdClassInfo- the referenced class infolog- the log
-
toStringWithSimpleNames
Render to string, using only simple names for classes.- Returns:
- the string representation, using simple names for classes.
-
toString
-