Package io.github.classgraph
Class TypeSignature
- java.lang.Object
-
- io.github.classgraph.ScanResultObject
-
- io.github.classgraph.HierarchicalTypeSignature
-
- io.github.classgraph.TypeSignature
-
- Direct Known Subclasses:
BaseTypeSignature
,ReferenceTypeSignature
public abstract class TypeSignature extends HierarchicalTypeSignature
A type signature for a reference type or base type. Subclasses areReferenceTypeSignature
(whose own subclasses areClassRefTypeSignature
,TypeVariableSignature
, andArrayTypeSignature
), andBaseTypeSignature
.
-
-
Field Summary
-
Fields inherited from class io.github.classgraph.HierarchicalTypeSignature
typeAnnotationInfo
-
Fields inherited from class io.github.classgraph.ScanResultObject
classRef, scanResult
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
TypeSignature()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract void
addTypeAnnotation(java.util.List<Classfile.TypePathNode> typePath, AnnotationInfo annotationInfo)
Add a type annotation to this type.abstract boolean
equalsIgnoringTypeParams(TypeSignature other)
Compare base types, ignoring generic type parameters.protected void
findReferencedClassInfo(java.util.Map<java.lang.String,ClassInfo> classNameToClassInfo, java.util.Set<ClassInfo> refdClassInfo, LogNode log)
GetClassInfo
objects for any classes referenced in the type signature.protected void
findReferencedClassNames(java.util.Set<java.lang.String> refdClassNames)
Get the names of any classes referenced in the type signature.AnnotationInfoList
getTypeAnnotationInfo()
Get a list ofAnnotationInfo
objects for any type annotations on this type, or null if none.(package private) static TypeSignature
parse(java.lang.String typeDescriptor, java.lang.String definingClass)
Parse a type signature.(package private) static TypeSignature
parse(Parser parser, java.lang.String definingClass)
Parse a type signature.-
Methods inherited from class io.github.classgraph.HierarchicalTypeSignature
addTypeAnnotation, setScanResult, toString, toStringInternal
-
Methods inherited from class io.github.classgraph.ScanResultObject
findReferencedClassInfo, getClassInfo, getClassName, loadClass, loadClass, loadClass, loadClass, toString, toString, toStringWithSimpleNames
-
-
-
-
Method Detail
-
findReferencedClassNames
protected void findReferencedClassNames(java.util.Set<java.lang.String> refdClassNames)
Get the names of any classes referenced in the type signature.- Parameters:
refdClassNames
- the referenced class names.
-
findReferencedClassInfo
protected final void findReferencedClassInfo(java.util.Map<java.lang.String,ClassInfo> classNameToClassInfo, java.util.Set<ClassInfo> refdClassInfo, LogNode log)
GetClassInfo
objects for any classes referenced in the type signature.- Overrides:
findReferencedClassInfo
in classScanResultObject
- Parameters:
classNameToClassInfo
- the map from class name toClassInfo
.refdClassInfo
- the referenced class info.log
- the log
-
getTypeAnnotationInfo
public AnnotationInfoList getTypeAnnotationInfo()
Get a list ofAnnotationInfo
objects for any type annotations on this type, or null if none.- Overrides:
getTypeAnnotationInfo
in classHierarchicalTypeSignature
- Returns:
- a list of
AnnotationInfo
objects for any type annotations on this type, or null if none.
-
equalsIgnoringTypeParams
public abstract boolean equalsIgnoringTypeParams(TypeSignature other)
Compare base types, ignoring generic type parameters.- Parameters:
other
- the otherTypeSignature
to compare to.- Returns:
- True if the two
TypeSignature
objects are equal, ignoring type parameters.
-
parse
static TypeSignature parse(Parser parser, java.lang.String definingClass) throws ParseException
Parse a type signature.- Parameters:
parser
- The parserdefiningClass
- The class containing the type descriptor.- Returns:
- The parsed type descriptor or type signature.
- Throws:
ParseException
- If the type signature could not be parsed.
-
parse
static TypeSignature parse(java.lang.String typeDescriptor, java.lang.String definingClass) throws ParseException
Parse a type signature.- Parameters:
typeDescriptor
- The type descriptor or type signature to parse.definingClass
- The class containing the type descriptor.- Returns:
- The parsed type descriptor or type signature.
- Throws:
ParseException
- If the type signature could not be parsed.
-
addTypeAnnotation
protected abstract void addTypeAnnotation(java.util.List<Classfile.TypePathNode> typePath, AnnotationInfo annotationInfo)
Add a type annotation to this type.- Specified by:
addTypeAnnotation
in classHierarchicalTypeSignature
- Parameters:
typePath
- The type path.annotationInfo
- The annotation to add.
-
-