public final class ClassRefTypeSignature extends ClassRefOrTypeVariableSignature
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Class<?> |
classRef
The class ref, once the class is loaded.
|
protected ScanResult |
scanResult
The scan result.
|
typeAnnotationInfo| Modifier and Type | Method and Description |
|---|---|
protected void |
addTypeAnnotation(java.util.List<io.github.classgraph.Classfile.TypePathNode> typePath,
AnnotationInfo annotationInfo)
Add a type annotation to this type.
|
boolean |
equals(java.lang.Object obj) |
boolean |
equalsIgnoringTypeParams(TypeSignature other)
Compare base types, ignoring generic type parameters.
|
protected void |
findReferencedClassNames(java.util.Set<java.lang.String> refdClassNames)
Get the names of any classes referenced in the type signature.
|
java.lang.String |
getBaseClassName()
Get the name of the class, without any suffixes.
|
ClassInfo |
getClassInfo()
Get the
ClassInfo object for the referenced class. |
protected java.lang.String |
getClassName()
The name of the class (used by
getClassInfo() to fetch the ClassInfo object for the class). |
java.lang.String |
getFullyQualifiedClassName()
Get the name of the class, formed from the base name and any suffixes (suffixes are for inner class nesting,
and are separated by '$'), but without any type arguments.
|
java.util.List<java.lang.String> |
getSuffixes()
Get all nested suffixes of the class (typically nested inner class names).
|
java.util.List<AnnotationInfoList> |
getSuffixTypeAnnotationInfo()
Get a list of lists of type annotations for all nested suffixes of the class, one list per suffix.
|
java.util.List<java.util.List<TypeArgument>> |
getSuffixTypeArguments()
Get a list of type arguments for all nested suffixes of the class, one list per suffix.
|
java.util.List<TypeArgument> |
getTypeArguments()
Get any type arguments of the base class.
|
int |
hashCode() |
java.lang.Class<?> |
loadClass()
Load the referenced class, if not already loaded, returning a {@code Class
|
java.lang.Class<?> |
loadClass(boolean ignoreExceptions)
Load the referenced class, if not already loaded, returning a {@code Class
|
java.lang.String |
toString()
Render to string.
|
protected void |
toStringInternal(boolean useSimpleNames,
AnnotationInfoList annotationsToExclude,
java.lang.StringBuilder buf)
Render type signature to string.
|
java.lang.String |
toStringWithSimpleNames()
Render to string, using only simple
names for classes.
|
findReferencedClassInfo, getTypeAnnotationInfoaddTypeAnnotation, toStringprotected transient ScanResult scanResult
protected transient java.lang.Class<?> classRef
public java.lang.String getBaseClassName()
getFullyQualifiedClassName()public java.lang.String getFullyQualifiedClassName()
"xyz.Cls<String>.InnerCls<Integer>" is returned as "xyz.Cls$InnerCls". The intent of this
method is that if you replace '.' with '/', and then add the suffix ".class", you end up with the path of the
classfile relative to the package root.
For comparison, toString() uses '.' to separate suffixes, and includes type parameters, whereas this
method uses '$' to separate suffixes, and does not include type parameters.
public java.util.List<TypeArgument> getTypeArguments()
public java.util.List<java.lang.String> getSuffixes()
public java.util.List<java.util.List<TypeArgument>> getSuffixTypeArguments()
public java.util.List<AnnotationInfoList> getSuffixTypeAnnotationInfo()
protected void addTypeAnnotation(java.util.List<io.github.classgraph.Classfile.TypePathNode> typePath,
AnnotationInfo annotationInfo)
TypeSignatureaddTypeAnnotation in class TypeSignaturetypePath - The type path.annotationInfo - The annotation to add.public java.lang.Class<?> loadClass(boolean ignoreExceptions)
Class<?> reference for the referenced
class. (Called by AnnotationClassRef.loadClass().)ignoreExceptions - if true, ignore exceptions and instead return null if the class could not be loaded.Class<?> reference for the referenced class.java.lang.IllegalArgumentException - if the class could not be loaded and ignoreExceptions was false.public java.lang.Class<?> loadClass()
Class<?> reference for the referenced
class. (Called by AnnotationClassRef.loadClass().)Class<?> reference for the referenced class.java.lang.IllegalArgumentException - if the class could not be loaded.protected java.lang.String getClassName()
getClassInfo() to fetch the ClassInfo object for the class).public ClassInfo getClassInfo()
ClassInfo object for the referenced class.ClassInfo object 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.protected void findReferencedClassNames(java.util.Set<java.lang.String> refdClassNames)
findReferencedClassNames in class TypeSignaturerefdClassNames - the referenced class names.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic boolean equalsIgnoringTypeParams(TypeSignature other)
TypeSignatureequalsIgnoringTypeParams in class TypeSignatureother - the other TypeSignature to compare to.TypeSignature objects are equal, ignoring type parameters.protected void toStringInternal(boolean useSimpleNames,
AnnotationInfoList annotationsToExclude,
java.lang.StringBuilder buf)
HierarchicalTypeSignaturetoStringInternal in class HierarchicalTypeSignatureuseSimpleNames - whether to use simple names for classes.annotationsToExclude - toplevel annotations to exclude, to eliminate duplication (toplevel annotations are both
class/field/method annotations and type annotations).buf - the StringBuilder to write to.public java.lang.String toStringWithSimpleNames()
public java.lang.String toString()
toString in class java.lang.Object