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
A type signature for a reference type or base type. Subclasses are
ReferenceTypeSignature
(whose own
subclasses are ClassRefTypeSignature
, TypeVariableSignature
, and ArrayTypeSignature
), and
BaseTypeSignature
.-
Field Summary
Fields inherited from class io.github.classgraph.HierarchicalTypeSignature
typeAnnotationInfo
Fields inherited from class io.github.classgraph.ScanResultObject
classRef, scanResult
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract void
addTypeAnnotation
(List<Classfile.TypePathNode> typePath, AnnotationInfo annotationInfo) Add a type annotation to this type.abstract boolean
Compare base types, ignoring generic type parameters.protected final void
findReferencedClassInfo
(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, LogNode log) GetClassInfo
objects for any classes referenced in the type signature.protected void
findReferencedClassNames
(Set<String> refdClassNames) Get the names of any classes referenced in the type signature.Get a list ofAnnotationInfo
objects for any type annotations on this type, or null if none.(package private) static TypeSignature
Parse a type signature.(package private) static TypeSignature
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
-
Constructor Details
-
TypeSignature
protected TypeSignature()Constructor.
-
-
Method Details
-
findReferencedClassNames
Get the names of any classes referenced in the type signature.- Parameters:
refdClassNames
- the referenced class names.
-
findReferencedClassInfo
protected final void findReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, 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
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
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
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
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(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.
-