Top Description Fields Constructors Methods
io.github.classgraph

pack-priv abstract Class ScanResultObject

extends Object
Class Inheritance
Known Direct Subclasses
io.github.classgraph.AnnotationClassRef, io.github.classgraph.AnnotationEnumValue, io.github.classgraph.AnnotationInfo, io.github.classgraph.AnnotationParameterValue, io.github.classgraph.ClassInfo, io.github.classgraph.ClassMemberInfo, io.github.classgraph.HierarchicalTypeSignature, io.github.classgraph.ObjectTypedValueWrapper
Imports
java.util.LinkedHashSet, .Map, .Set, nonapi.io.github.classgraph.utils.LogNode

A superclass of objects accessible from a ScanResult that are associated with a ClassInfo object.

Field Summary

Modifier and TypeField and Description
private transient ClassInfo
classInfo

The associated ClassInfo object.

protected transient Class<?>
classRef

The class ref, once the class is loaded.

protected transient ScanResult
scanResult

The scan result.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv final Set<ClassInfo>

Returns:

the referenced class info.
findReferencedClassInfo
(final LogNode
the log
log
)

Get ClassInfo objects for any classes referenced by this object.

protected void
findReferencedClassInfo(final Map<String, ClassInfo>
the map from class name to ClassInfo.
classNameToClassInfo
,
final Set<ClassInfo>
the referenced class info
refdClassInfo
,
final LogNode
the log
log
)

Get ClassInfo objects for any classes referenced by this object.

pack-priv ClassInfo

Returns:

The ClassInfo object for the referenced class.
getClassInfo
()

Get the ClassInfo object for the referenced class, or null if the referenced class was not encountered during scanning (i.e. no ClassInfo object was created for the class during scanning).

private String

Returns:

the class name
getClassInfoNameOrClassName
()

Get the class name by calling getClassInfo().getName(), or as a fallback, by calling getClassName().

protected abstract String

Returns:

The class name.
getClassName
()

The name of the class (used by getClassInfo() to fetch the ClassInfo object for the class).

pack-priv <
the superclass or interface type
T
>
Class<T>

Returns:

The Class<?> reference for the referenced class, or null if the class could not be loaded (or casting failed) and ignoreExceptions is true.
loadClass
(final Class<T>
The type to cast the resulting class reference to.
superclassOrInterfaceType
,
final boolean
If true, ignore classloading exceptions and return null on failure.
ignoreExceptions
)

Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName().

pack-priv <
the superclass or interface type
T
>
Class<T>

Returns:

The Class<?> reference for the referenced class, or null if the class could not be loaded (or casting failed) and ignoreExceptions is true.
loadClass
(final Class<T>
The type to cast the resulting class reference to.
superclassOrInterfaceType
)

Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName().

pack-priv Class<?>

Returns:

The Class<?> reference for the referenced class, or null if the class could not be loaded and ignoreExceptions is true.
loadClass
(final boolean
If true, ignore classloading exceptions and return null on failure.
ignoreExceptions
)

Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName().

pack-priv Class<?>

Returns:

The Class<?> reference for the referenced class.
loadClass
()

Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName().

pack-priv void
setScanResult(final ScanResult
the scan result
scanResult
)

Set ScanResult backreferences in info objects after scan has completed.

protected abstract void
toString(final boolean
if true, use just the simple name of each class.
useSimpleNames
,
StringBuilder
the buf
buf
)

Render to string.

pack-priv String

Returns:

the string representation.
toString
(final boolean
if true, use just the simple name of each class.
useSimpleNames
)

Render to string, with simple names for classes if useSimpleNames is true.

public String

Returns:

the string representation.
toString
()

Overrides java.lang.Object.toString.

Render to string.

public String

Returns:

the string representation, using simple names for classes.
toStringWithSimpleNames
()

Render to string, using only simple names for classes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

classInfoback to summary
private transient ClassInfo classInfo

The associated ClassInfo object.

classRefback to summary
protected transient Class<?> classRef

The class ref, once the class is loaded.

scanResultback to summary
protected transient ScanResult scanResult

The scan result.

Constructor Detail

ScanResultObjectback to summary
pack-priv ScanResultObject()

Method Detail

findReferencedClassInfoback to summary
pack-priv final Set<ClassInfo> findReferencedClassInfo(final LogNode log)

Get ClassInfo objects for any classes referenced by this object.

Parameters
log:LogNode

the log

Returns:Set<ClassInfo>

the referenced class info.

findReferencedClassInfoback to summary
protected void findReferencedClassInfo(final Map<String, ClassInfo> classNameToClassInfo, final Set<ClassInfo> refdClassInfo, final LogNode log)

Get ClassInfo objects for any classes referenced by this object.

Parameters
classNameToClassInfo:Map<String, ClassInfo>

the map from class name to ClassInfo.

refdClassInfo:Set<ClassInfo>

the referenced class info

log:LogNode

the log

getClassInfoback to summary
pack-priv ClassInfo getClassInfo()

Get the ClassInfo object for the referenced class, or null if the referenced class was not encountered during scanning (i.e. 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.

Returns:ClassInfo

The ClassInfo object for the referenced class.

getClassInfoNameOrClassNameback to summary
private String getClassInfoNameOrClassName()

Get the class name by calling getClassInfo().getName(), or as a fallback, by calling getClassName().

Returns:String

the class name

getClassNameback to summary
protected abstract String getClassName()

The name of the class (used by getClassInfo() to fetch the ClassInfo object for the class).

Returns:String

The class name.

loadClassback to summary
pack-priv <T> Class<T> loadClass(final Class<T> superclassOrInterfaceType, final boolean ignoreExceptions)

Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName(). Returns a Class<?> reference for the class, cast to the requested superclass or interface type.

Parameters
<T>
the superclass or interface type
superclassOrInterfaceType:Class<T>

The type to cast the resulting class reference to.

ignoreExceptions:boolean

If true, ignore classloading exceptions and return null on failure.

Returns:Class<T>

The Class<?> reference for the referenced class, or null if the class could not be loaded (or casting failed) and ignoreExceptions is true.

Exceptions
IllegalArgumentException:
if the class could not be loaded or cast, and ignoreExceptions was false.
loadClassback to summary
pack-priv <T> Class<T> loadClass(final Class<T> superclassOrInterfaceType)

Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName(). Returns a Class<?> reference for the class, cast to the requested superclass or interface type.

Parameters
<T>
the superclass or interface type
superclassOrInterfaceType:Class<T>

The type to cast the resulting class reference to.

Returns:Class<T>

The Class<?> reference for the referenced class, or null if the class could not be loaded (or casting failed) and ignoreExceptions is true.

Exceptions
IllegalArgumentException:
if the class could not be loaded or cast, and ignoreExceptions was false.
loadClassback to summary
pack-priv Class<?> loadClass(final boolean ignoreExceptions)

Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName(). Returns a Class<?> reference for the class.

Parameters
ignoreExceptions:boolean

If true, ignore classloading exceptions and return null on failure.

Returns:Class<?>

The Class<?> reference for the referenced class, or null if the class could not be loaded and ignoreExceptions is true.

Exceptions
IllegalArgumentException:
if the class could not be loaded and ignoreExceptions was false.
loadClassback to summary
pack-priv Class<?> loadClass()

Load the class named returned by getClassInfo(), or if that returns null, the class named by getClassName(). Returns a Class<?> reference for the class.

Returns:Class<?>

The Class<?> reference for the referenced class.

Exceptions
IllegalArgumentException:
if the class could not be loaded.
setScanResultback to summary
pack-priv void setScanResult(final ScanResult scanResult)

Set ScanResult backreferences in info objects after scan has completed.

Parameters
scanResult:ScanResult

the scan result

toStringback to summary
protected abstract void toString(final boolean useSimpleNames, StringBuilder buf)

Render to string.

Parameters
useSimpleNames:boolean

if true, use just the simple name of each class.

buf:StringBuilder

the buf

toStringback to summary
pack-priv String toString(final boolean useSimpleNames)

Render to string, with simple names for classes if useSimpleNames is true.

Parameters
useSimpleNames:boolean

if true, use just the simple name of each class.

Returns:String

the string representation.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Render to string.

Returns:String

the string representation.

Annotations
@Override
toStringWithSimpleNamesback to summary
public String toStringWithSimpleNames()

Render to string, using only simple names for classes.

Returns:String

the string representation, using simple names for classes.