Class ClassTypeSignature
- java.lang.Object
-
- io.github.lukehutch.fastclasspathscanner.typesignature.HierarchicalTypeSignature
-
- io.github.lukehutch.fastclasspathscanner.typesignature.ClassTypeSignature
-
public class ClassTypeSignature extends HierarchicalTypeSignature
A class type signature (called "ClassSignature" in the classfile documentation).
-
-
Constructor Summary
Constructors Constructor Description ClassTypeSignature(List<TypeParameter> typeParameters, ClassRefTypeSignature superclassSignature, List<ClassRefTypeSignature> superinterfaceSignatures)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object obj)voidgetAllReferencedClassNames(Set<String> classNameListOut)Get the names of all classes referenced in the type signatureClassRefTypeSignaturegetSuperclassSignature()Get the type signature for the superclass (possibly null in the case ofObject, since it doesn't have a superclass).List<ClassRefTypeSignature>getSuperinterfaceSignatures()Get the type signatures of any superinterfacesList<TypeParameter>getTypeParameters()Get the type parameters for the class.inthashCode()static ClassTypeSignatureparse(String typeDescriptor)Parse a class type signature or class type descriptor.StringtoString()StringtoString(int modifiers, boolean isAnnotation, boolean isInterface, String className)Render into String form.
-
-
-
Constructor Detail
-
ClassTypeSignature
public ClassTypeSignature(List<TypeParameter> typeParameters, ClassRefTypeSignature superclassSignature, List<ClassRefTypeSignature> superinterfaceSignatures)
- Parameters:
typeParameters- The class type parameters.superclassSignature- The superclass signature.superinterfaceSignatures- The superinterface signature(s).
-
-
Method Detail
-
getTypeParameters
public List<TypeParameter> getTypeParameters()
Get the type parameters for the class.- Returns:
- The type parameters for the class.
-
getSuperclassSignature
public ClassRefTypeSignature getSuperclassSignature()
Get the type signature for the superclass (possibly null in the case ofObject, since it doesn't have a superclass).- Returns:
- The type signature for the superclass, or null if no superclass (i.e. for
Object).
-
getSuperinterfaceSignatures
public List<ClassRefTypeSignature> getSuperinterfaceSignatures()
Get the type signatures of any superinterfaces- Returns:
- The type signatures of any superinterfaces.
-
getAllReferencedClassNames
public void getAllReferencedClassNames(Set<String> classNameListOut)
Description copied from class:HierarchicalTypeSignatureGet the names of all classes referenced in the type signature- Specified by:
getAllReferencedClassNamesin classHierarchicalTypeSignature- Parameters:
classNameListOut- The set to store class names in.
-
toString
public String toString(int modifiers, boolean isAnnotation, boolean isInterface, String className)
Render into String form.- Parameters:
modifiers- The class modifiers.isAnnotation- True if the class is an annotation.isInterface- True if the class is an interface.className- The class name- Returns:
- The String representation.
-
parse
public static ClassTypeSignature parse(String typeDescriptor) throws Parser.ParseException
Parse a class type signature or class type descriptor.- Parameters:
typeDescriptor- The class type signature or class type descriptor to parse.- Returns:
- The parsed class type signature or class type descriptor.
- Throws:
Parser.ParseException- If the class type signature could not be parsed.
-
-