public final class ClassRefTypeSignature extends ClassRefOrTypeVariableSignature
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
boolean |
equalsIgnoringTypeParams(TypeSignature other)
Compare base types, ignoring generic type parameters.
|
String |
getBaseClassName()
Get the name of the class, without any suffixes.
|
ClassInfo |
getClassInfo()
Get the
ClassInfo object for the referenced class. |
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.
|
List<String> |
getSuffixes()
Get all nested suffixes of the class (typically nested inner class names).
|
List<AnnotationInfoList> |
getSuffixTypeAnnotationInfo()
Get a list of lists of type annotations for all nested suffixes of the class, one list per suffix.
|
List<List<TypeArgument>> |
getSuffixTypeArguments()
Get a list of type arguments for all nested suffixes of the class, one list per suffix.
|
List<TypeArgument> |
getTypeArguments()
Get any type arguments of the base class.
|
int |
hashCode() |
Class<?> |
loadClass()
Load the referenced class, if not already loaded, returning a
Class<?> reference for the referenced
class. |
Class<?> |
loadClass(boolean ignoreExceptions)
Load the referenced class, if not already loaded, returning a
Class<?> reference for the referenced
class. |
String |
toString()
Render to string.
|
String |
toStringWithSimpleNames()
Render to string, using only simple
names for classes.
|
getTypeAnnotationInfo
public String getBaseClassName()
getFullyQualifiedClassName()
public 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 List<TypeArgument> getTypeArguments()
public List<String> getSuffixes()
public List<List<TypeArgument>> getSuffixTypeArguments()
public List<AnnotationInfoList> getSuffixTypeAnnotationInfo()
public 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.IllegalArgumentException
- if the class could not be loaded and ignoreExceptions was false.public Class<?> loadClass()
Class<?>
reference for the referenced
class. (Called by AnnotationClassRef.loadClass()
.)Class<?>
reference for the referenced class.IllegalArgumentException
- if the class could not be loaded.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.public boolean equalsIgnoringTypeParams(TypeSignature other)
TypeSignature
equalsIgnoringTypeParams
in class TypeSignature
other
- the other TypeSignature
to compare to.TypeSignature
objects are equal, ignoring type parameters.public String toStringWithSimpleNames()
Copyright © 2021. All rights reserved.