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 protectedTypeSignature()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidaddTypeAnnotation(java.util.List<Classfile.TypePathNode> typePath, AnnotationInfo annotationInfo)Add a type annotation to this type.abstract booleanequalsIgnoringTypeParams(TypeSignature other)Compare base types, ignoring generic type parameters.protected voidfindReferencedClassInfo(java.util.Map<java.lang.String,ClassInfo> classNameToClassInfo, java.util.Set<ClassInfo> refdClassInfo, LogNode log)GetClassInfoobjects for any classes referenced in the type signature.protected voidfindReferencedClassNames(java.util.Set<java.lang.String> refdClassNames)Get the names of any classes referenced in the type signature.AnnotationInfoListgetTypeAnnotationInfo()Get a list ofAnnotationInfoobjects for any type annotations on this type, or null if none.(package private) static TypeSignatureparse(java.lang.String typeDescriptor, java.lang.String definingClass)Parse a type signature.(package private) static TypeSignatureparse(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)
GetClassInfoobjects for any classes referenced in the type signature.- Overrides:
findReferencedClassInfoin classScanResultObject- Parameters:
classNameToClassInfo- the map from class name toClassInfo.refdClassInfo- the referenced class info.log- the log
-
getTypeAnnotationInfo
public AnnotationInfoList getTypeAnnotationInfo()
Get a list ofAnnotationInfoobjects for any type annotations on this type, or null if none.- Overrides:
getTypeAnnotationInfoin classHierarchicalTypeSignature- Returns:
- a list of
AnnotationInfoobjects 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 otherTypeSignatureto compare to.- Returns:
- True if the two
TypeSignatureobjects 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:
addTypeAnnotationin classHierarchicalTypeSignature- Parameters:
typePath- The type path.annotationInfo- The annotation to add.
-
-