Class TypeVariableSignature
java.lang.Object
io.github.classgraph.HierarchicalTypeSignature
io.github.classgraph.TypeSignature
io.github.classgraph.ReferenceTypeSignature
io.github.classgraph.ClassRefOrTypeVariableSignature
io.github.classgraph.TypeVariableSignature
A type variable signature.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Class<?> The class ref, once the class is loaded.protected ScanResultThe scan result.Fields inherited from class HierarchicalTypeSignature
typeAnnotationInfo -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddTypeAnnotation(List<io.github.classgraph.Classfile.TypePathNode> typePath, AnnotationInfo annotationInfo) Add a type annotation to this type.booleanbooleanCompare base types, ignoring generic type parameters.protected voidfindReferencedClassNames(Set<String> refdClassNames) Get the names of any classes referenced in the type signature.protected StringReturn definingClassName, so that getClassInfo() returns theClassInfoobject for the containing class.getName()Get the name of the type variable.inthashCode()resolve()Look up a type variable (e.g.toString()Render to string.protected voidtoStringInternal(boolean useSimpleNames, AnnotationInfoList annotationsToExclude, StringBuilder buf) Render type signature to string.Render to string, using only simple names for classes.Returns the type variable along with its type bound, if available (e.g.Methods inherited from class TypeSignature
findReferencedClassInfo, getTypeAnnotationInfoMethods inherited from class HierarchicalTypeSignature
addTypeAnnotation, toString
-
Field Details
-
scanResult
The scan result. -
classRef
The class ref, once the class is loaded.
-
-
Method Details
-
getName
-
resolve
Look up a type variable (e.g. "T") in the defining method and/or enclosing class' type parameters, and return the type parameter with the same name (e.g. "T extends com.xyz.Cls").- Returns:
- the type parameter (e.g. "T extends com.xyz.Cls", or simply "T" if the type parameter does not have any bounds).
- Throws:
IllegalArgumentException- if a type parameter with the same name as the type variable could not be found in the defining method or the enclosing class.
-
addTypeAnnotation
protected void addTypeAnnotation(List<io.github.classgraph.Classfile.TypePathNode> typePath, AnnotationInfo annotationInfo) Description copied from class:TypeSignatureAdd a type annotation to this type.- Specified by:
addTypeAnnotationin classTypeSignature- Parameters:
typePath- The type path.annotationInfo- The annotation to add.
-
getClassName
-
findReferencedClassNames
Get the names of any classes referenced in the type signature.- Overrides:
findReferencedClassNamesin classTypeSignature- Parameters:
refdClassNames- the referenced class names.
-
hashCode
-
equals
-
equalsIgnoringTypeParams
Description copied from class:TypeSignatureCompare base types, ignoring generic type parameters.- Specified by:
equalsIgnoringTypeParamsin classTypeSignature- Parameters:
other- the otherTypeSignatureto compare to.- Returns:
- True if the two
TypeSignatureobjects are equal, ignoring type parameters.
-
toStringWithTypeBound
Returns the type variable along with its type bound, if available (e.g. "X extends xyz.Cls"). You can get this in structured form by callingresolve(). Returns just the type variable if there is no type bound, or if no type bound is known (i.e. ifresolve()returns null).- Returns:
- The string representation.
-
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.
-
toStringWithSimpleNames
Render to string, using only simple names for classes.- Returns:
- the string representation, using simple names for classes.
-
toString
-