Class ArrayTypeSignature
java.lang.Object
io.github.classgraph.HierarchicalTypeSignature
io.github.classgraph.TypeSignature
io.github.classgraph.ReferenceTypeSignature
io.github.classgraph.ArrayTypeSignature
An array type 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.Return anArrayClassInfoinstance for the array class, cast to its superclass.protected ClassInfoprotected StringThe name of the class (used byScanResultObject.getClassInfo()to fetch theClassInfoobject for the class).Get the type signature of the innermost element type of the array.Get the nested type, which is anotherArrayTypeSignaturewith one dimension fewer, if this array has 2 or more dimensions, otherwise this returns the element type.intGet the number of dimensions of the array.Get a list ofAnnotationInfoobjects for the type annotations on this array type, or null if none.Get the raw array type signature string, e.g.inthashCode()Class<?> Obtain aClass<?>reference for the array class named by thisArrayClassInfoobject.Class<?> loadClass(boolean ignoreExceptions) Obtain aClass<?>reference for the array class named by thisArrayClassInfoobject.Class<?> Get aClass<?>reference for the array element type.Class<?> loadElementClass(boolean ignoreExceptions) Get aClass<?>reference for the innermost array element type.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.Methods inherited from class TypeSignature
findReferencedClassInfoMethods inherited from class HierarchicalTypeSignature
addTypeAnnotation, toString
-
Field Details
-
scanResult
The scan result. -
classRef
The class ref, once the class is loaded.
-
-
Method Details
-
getTypeSignatureStr
Get the raw array type signature string, e.g. "[[I".- Returns:
- the raw array type signature string.
-
getElementTypeSignature
Get the type signature of the innermost element type of the array.- Returns:
- The type signature of the innermost element type.
-
getNumDimensions
public int getNumDimensions()Get the number of dimensions of the array.- Returns:
- The number of dimensions of the array.
-
getNestedType
Get the nested type, which is anotherArrayTypeSignaturewith one dimension fewer, if this array has 2 or more dimensions, otherwise this returns the element type.- Returns:
- The nested type.
-
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.
-
getTypeAnnotationInfo
Get a list ofAnnotationInfoobjects for the type annotations on this array type, or null if none.- Overrides:
getTypeAnnotationInfoin classTypeSignature- Returns:
- a list of
AnnotationInfoobjects for the type annotations of on this array type, or null if none. - See Also:
-
getClassName
-
getClassInfo
-
getArrayClassInfo
Return anArrayClassInfoinstance for the array class, cast to its superclass.- Returns:
- the
ArrayClassInfoinstance.
-
findReferencedClassNames
Get the names of any classes referenced in the type signature.- Overrides:
findReferencedClassNamesin classTypeSignature- Parameters:
refdClassNames- the referenced class names.
-
loadElementClass
Get aClass<?>reference for the innermost array element type. Causes the ClassLoader to load the class, if it is not already loaded.- Parameters:
ignoreExceptions- Whether or not to ignore exceptions.- Returns:
- a
Class<?>reference for the innermost array element type. Also works for arrays of primitive element type.
-
loadElementClass
Get aClass<?>reference for the array element type. Causes the ClassLoader to load the element class, if it is not already loaded.- Returns:
- a
Class<?>reference for the array element type. Also works for arrays of primitive element type.
-
loadClass
Obtain aClass<?>reference for the array class named by thisArrayClassInfoobject. Causes the ClassLoader to load the element class, if it is not already loaded.- Parameters:
ignoreExceptions- Whether or not to ignore exceptions.- Returns:
- The class reference, or null, if ignoreExceptions is true and there was an exception or error loading the class.
- Throws:
IllegalArgumentException- if ignoreExceptions is false and there were problems loading the class.
-
loadClass
Obtain aClass<?>reference for the array class named by thisArrayClassInfoobject. Causes the ClassLoader to load the element class, if it is not already loaded.- Returns:
- The class reference.
- Throws:
IllegalArgumentException- if there were problems loading the class.
-
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.
-
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
-