Class TypeSignature
- java.lang.Object
-
- io.github.lukehutch.fastclasspathscanner.typesignature.HierarchicalTypeSignature
-
- io.github.lukehutch.fastclasspathscanner.typesignature.TypeSignature
-
- Direct Known Subclasses:
BaseTypeSignature,ReferenceTypeSignature
public abstract class TypeSignature extends HierarchicalTypeSignature
A type signature for a reference type or base type. Subclasses are ReferenceTypeSignature (ClassTypeSignature, TypeVariableSignature, or ArrayTypeSignature) and BaseTypeSignature.
-
-
Constructor Summary
Constructors Constructor Description TypeSignature()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract booleanequalsIgnoringTypeParams(TypeSignature other)Compare base types, ignoring generic type parameters.abstract Class<?>instantiate(ScanResult scanResult)Instantiate the type signature into a class reference.static TypeSignatureparse(String typeDescriptor)Parse a type signature.-
Methods inherited from class io.github.lukehutch.fastclasspathscanner.typesignature.HierarchicalTypeSignature
getAllReferencedClassNames
-
-
-
-
Method Detail
-
instantiate
public abstract Class<?> instantiate(ScanResult scanResult)
Instantiate the type signature into a class reference. The ScanResult is used to ensure the correct classloader is used to load the class.- Parameters:
scanResult- The scan result.- Returns:
- The instantiation of the type signature as a
Class<?>.
-
equalsIgnoringTypeParams
public abstract boolean equalsIgnoringTypeParams(TypeSignature other)
Compare base types, ignoring generic type parameters.- Parameters:
other- the otherTypeSignatureto compare to.- Returns:
- True if the two
TypeSignatureobjects are equal, ignoring type parameters.
-
parse
public static TypeSignature parse(String typeDescriptor) throws Parser.ParseException
Parse a type signature.- Parameters:
typeDescriptor- The type descriptor or type signature to parse.- Returns:
- The parsed type descriptor or type signature.
- Throws:
Parser.ParseException- If type signature could not be parsed.
-
-