Package io.github.fastclasspathscanner
Class ClassRefTypeSignature
- java.lang.Object
-
- io.github.fastclasspathscanner.HierarchicalTypeSignature
-
- io.github.fastclasspathscanner.TypeSignature
-
- io.github.fastclasspathscanner.ReferenceTypeSignature
-
- io.github.fastclasspathscanner.ClassRefOrTypeVariableSignature
-
- io.github.fastclasspathscanner.ClassRefTypeSignature
-
public class ClassRefTypeSignature extends ClassRefOrTypeVariableSignature
A class reference type signature (called "ClassTypeSignature" in the classfile documentation).
-
-
Field Summary
Fields Modifier and Type Field Description protected ScanResultscanResult
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)booleanequalsIgnoringTypeParams(TypeSignature other)Compare base types, ignoring generic type parameters.StringgetBaseClassName()Get the name of the base class.ClassInfogetClassInfo()Get theClassInfoobject for the referenced class, or null if the referenced class was not encountered during scanning (i.e.protected StringgetClassName()Get the fully qualified class name (used bygetClassInfo()andloadClass().voidgetClassNamesFromTypeDescriptors(Set<String> classNameListOut)StringgetFullyQualifiedClassName()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 any suffixes of the class (typically nested inner class names).List<List<TypeArgument>>getSuffixTypeArguments()Get any type arguments for any suffixes of the class, one list per suffix.List<TypeArgument>getTypeArguments()Get any type arguments of the base class.inthashCode()Class<?>loadClass()Load the referenced class, if not already loaded, returning aClass<?>reference for the referenced class.StringtoString()
-
-
-
Field Detail
-
scanResult
protected transient ScanResult scanResult
-
-
Method Detail
-
getBaseClassName
public String getBaseClassName()
Get the name of the base class.- Returns:
- The name of the base class.
-
getFullyQualifiedClassName
public 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. For example,"xyz.Cls<String>$InnerCls<Integer>"is returned as"xyz.Cls$InnerCls".- Returns:
- The fully-qualified name of the class, including suffixes but without type arguments.
-
getClassName
protected String getClassName()
Get the fully qualified class name (used bygetClassInfo()andloadClass().- Returns:
- The fully qualified name of the class.
-
getClassInfo
public ClassInfo getClassInfo()
Get theClassInfoobject 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:
- The
ClassInfoobject for the referenced class.
-
loadClass
public Class<?> loadClass()
Load the referenced class, if not already loaded, returning aClass<?>reference for the referenced class. (Called byAnnotationClassRef.loadClass().)- Returns:
- The
Class<?>reference for the referenced class. - Throws:
IllegalArgumentException- if the class could not be loaded.
-
getTypeArguments
public List<TypeArgument> getTypeArguments()
Get any type arguments of the base class.- Returns:
- The type arguments for the base class.
-
getSuffixes
public List<String> getSuffixes()
Get any suffixes of the class (typically nested inner class names).- Returns:
- The class suffixes (for inner classes).
-
getSuffixTypeArguments
public List<List<TypeArgument>> getSuffixTypeArguments()
Get any type arguments for any suffixes of the class, one list per suffix.- Returns:
- The type arguments for the inner classes, one list per suffix.
-
getClassNamesFromTypeDescriptors
public void getClassNamesFromTypeDescriptors(Set<String> classNameListOut)
-
equalsIgnoringTypeParams
public boolean equalsIgnoringTypeParams(TypeSignature other)
Description copied from class:TypeSignatureCompare base types, ignoring generic type parameters.- Specified by:
equalsIgnoringTypeParamsin classTypeSignature- Parameters:
other- the otherTypeSignatureto compare to.- Returns:
- True if the two
TypeSignatureobjects are equal, ignoring type parameters.
-
-