Class TypeParameter
java.lang.Object
io.github.classgraph.ScanResultObject
io.github.classgraph.HierarchicalTypeSignature
io.github.classgraph.TypeParameter
A type parameter.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final ReferenceTypeSignatureClass bound -- may be null.(package private) final List<ReferenceTypeSignature> Interface bounds -- may be empty.(package private) final StringThe type parameter identifier.Fields inherited from class HierarchicalTypeSignature
typeAnnotationInfoFields inherited from class ScanResultObject
classRef, scanResult -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTypeParameter(String identifier, ReferenceTypeSignature classBound, List<ReferenceTypeSignature> interfaceBounds) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddTypeAnnotation(List<Classfile.TypePathNode> typePath, AnnotationInfo annotationInfo) Add a type annotation.booleanprotected voidfindReferencedClassNames(Set<String> refdClassNames) Get the names of any classes referenced in the type signature.Get the type parameter class bound.protected ClassInfoGet theClassInfoobject for the referenced class, or null if the referenced class was not encountered during scanning (i.e.protected StringThe name of the class (used byScanResultObject.getClassInfo()to fetch theClassInfoobject for the class).Get the type parameter interface bound(s).getName()Get the type parameter identifier.inthashCode()(package private) static List<TypeParameter> Parse a list of type parameters intoTypeParameterobjects.(package private) voidsetScanResult(ScanResult scanResult) Set ScanResult backreferences in info objects after scan has completed.protected voidtoStringInternal(boolean useSimpleNames, AnnotationInfoList annotationsToExclude, StringBuilder buf) Render type signature to string.Methods inherited from class HierarchicalTypeSignature
addTypeAnnotation, getTypeAnnotationInfo, toStringMethods inherited from class ScanResultObject
findReferencedClassInfo, findReferencedClassInfo, loadClass, loadClass, loadClass, loadClass, toString, toString, toStringWithSimpleNames
-
Field Details
-
name
The type parameter identifier. -
classBound
Class bound -- may be null. -
interfaceBounds
Interface bounds -- may be empty.
-
-
Constructor Details
-
TypeParameter
protected TypeParameter(String identifier, ReferenceTypeSignature classBound, List<ReferenceTypeSignature> interfaceBounds) Constructor.- Parameters:
identifier- The type parameter identifier.classBound- The type parameter class bound.interfaceBounds- The type parameter interface bound.
-
-
Method Details
-
getName
-
getClassBound
Get the type parameter class bound.- Returns:
- The type parameter class bound. May be null.
-
getInterfaceBounds
Get the type parameter interface bound(s).- Returns:
- Get the type parameter interface bound(s), which may be the empty list.
-
addTypeAnnotation
protected void addTypeAnnotation(List<Classfile.TypePathNode> typePath, AnnotationInfo annotationInfo) Description copied from class:HierarchicalTypeSignatureAdd a type annotation.- Specified by:
addTypeAnnotationin classHierarchicalTypeSignature- Parameters:
typePath- the type pathannotationInfo- the annotation
-
parseList
Parse a list of type parameters intoTypeParameterobjects.- Parameters:
parser- the parserdefiningClassName- the defining class name- Returns:
- the list of
TypeParameterobjects. - Throws:
ParseException- if parsing fails
-
getClassName
Description copied from class:ScanResultObjectThe name of the class (used byScanResultObject.getClassInfo()to fetch theClassInfoobject for the class).- Specified by:
getClassNamein classScanResultObject- Returns:
- The class name.
-
getClassInfo
Description copied from class:ScanResultObjectGet theClassInfoobject for the referenced class, or null if the referenced class was not encountered during scanning (i.e. no ClassInfo object was created for the class during scanning). N.B. even if this method returns null,ScanResultObject.loadClass()may be able to load the referenced class by name.- Overrides:
getClassInfoin classScanResultObject- Returns:
- The
ClassInfoobject for the referenced class.
-
setScanResult
Description copied from class:ScanResultObjectSet ScanResult backreferences in info objects after scan has completed.- Overrides:
setScanResultin classHierarchicalTypeSignature- Parameters:
scanResult- the scan result
-
findReferencedClassNames
-
hashCode
-
equals
-
toStringInternal
protected void toStringInternal(boolean useSimpleNames, AnnotationInfoList annotationsToExclude, StringBuilder buf) Description copied from class:HierarchicalTypeSignatureRender type signature to string.- Specified by:
toStringInternalin classHierarchicalTypeSignature- Parameters:
useSimpleNames- whether to use simple names for classes.annotationsToExclude- toplevel annotations to exclude, to eliminate duplication (toplevel annotations are both class/field/method annotations and type annotations).buf- theStringBuilderto write to.
-