Class ArrayClassInfo
java.lang.Object
io.github.classgraph.ScanResultObject
io.github.classgraph.ClassInfo
io.github.classgraph.ArrayClassInfo
- All Implemented Interfaces:
HasName, Comparable<ClassInfo>
Holds metadata about an array class. This class extends
ClassInfo with additional methods relevant to
array classes, in particular getArrayTypeSignature(), getTypeSignatureStr(),
getElementTypeSignature(), getElementClassInfo(), loadElementClass(), and
getNumDimensions().
An ArrayClassInfo object will not have any methods, fields or annotations.
ClassInfo.isArrayClass() will return true for this subclass of ClassInfo.
-
Nested Class Summary
Nested classes/interfaces inherited from class ClassInfo
ClassInfo.ReachableAndDirectlyRelatedClasses, ClassInfo.RelType -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ArrayTypeSignatureThe array type signature.private ClassInfoThe element class info.Fields inherited from class ClassInfo
annotationDefaultParamValues, annotationDefaultParamValuesHasBeenConvertedToPrimitive, annotationInfo, classfileResource, classLoader, classpathElement, fieldInfo, isExternalClass, isInherited, isScannedClass, methodInfo, moduleInfo, name, packageInfo, typeAnnotationDecorators, typeSignatureStrFields inherited from class ScanResultObject
classRef, scanResult -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for deserialization.ArrayClassInfo(ArrayTypeSignature arrayTypeSignature) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleanUse class name for equals().protected voidfindReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, LogNode log) GetClassInfoobjects for any classes referenced in the type descriptor or type signature.Get the type signature of the class.Get theClassInfoinstance for the array element type.Get the type signature of the array elements.intGet the number of dimensions of the array.Returns null, because array classes do not have a ClassTypeSignature.Get the raw type signature string of the array class, e.g.inthashCode()Use hash code of class name.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 array element type.(package private) voidsetScanResult(ScanResult scanResult) Set ScanResult backreferences in info objects after scan has completed.Methods inherited from class ClassInfo
addAnnotationParamDefaultValues, addClassAnnotation, addClassContainment, addFieldInfo, addFullyQualifiedDefiningMethodName, addImplementedInterface, addMethodInfo, addReferencedClassNames, addRelatedClass, addScannedClass, addSuperclass, addTypeDecorators, compareTo, extendsSuperclass, extendsSuperclass, getAllAnnotationClasses, getAllClasses, getAllEnums, getAllImplementedInterfaceClasses, getAllInterfacesOrAnnotationClasses, getAllRecords, getAllStandardClasses, getAnnotationDefaultParameterValues, getAnnotationInfo, getAnnotationInfo, getAnnotationInfo, getAnnotationInfoRepeatable, getAnnotationInfoRepeatable, getAnnotations, getClassDependencies, getClassesImplementing, getClassesWithAnnotation, getClassesWithAnnotationDirectOnly, getClassesWithFieldAnnotation, getClassesWithFieldAnnotationDirectOnly, getClassesWithMethodAnnotation, getClassesWithMethodAnnotationDirectOnly, getClassesWithMethodParameterAnnotation, getClassesWithMethodParameterAnnotationDirectOnly, getClassfileMajorVersion, getClassfileMinorVersion, getClassInfo, getClassName, getClasspathElementFile, getClasspathElementURI, getClasspathElementURL, getConstructorInfo, getDeclaredConstructorInfo, getDeclaredFieldInfo, getDeclaredFieldInfo, getDeclaredMethodAndConstructorInfo, getDeclaredMethodInfo, getDeclaredMethodInfo, getEnumConstantObjects, getEnumConstants, getFieldAnnotations, getFieldInfo, getFieldInfo, getFullyQualifiedDefiningMethodName, getInnerClasses, getInterfaces, getMethodAndConstructorInfo, getMethodAnnotations, getMethodInfo, getMethodInfo, getMethodParameterAnnotations, getModifiers, getModifiersStr, getModuleInfo, getModuleRef, getName, getOrCreateClassInfo, getOuterClasses, getPackageInfo, getPackageName, getResource, getSimpleName, getSimpleName, getSourceFile, getSubclasses, getSuperclass, getSuperclasses, getTypeDescriptor, getTypeSignatureOrTypeDescriptor, handleRepeatableAnnotations, hasAnnotation, hasAnnotation, hasDeclaredField, hasDeclaredFieldAnnotation, hasDeclaredFieldAnnotation, hasDeclaredMethod, hasDeclaredMethodAnnotation, hasDeclaredMethodAnnotation, hasDeclaredMethodParameterAnnotation, hasDeclaredMethodParameterAnnotation, hasField, hasFieldAnnotation, hasFieldAnnotation, hasMethod, hasMethodAnnotation, hasMethodAnnotation, hasMethodParameterAnnotation, hasMethodParameterAnnotation, implementsInterface, implementsInterface, isAbstract, isAnnotation, isAnonymousInnerClass, isArrayClass, isEnum, isExternalClass, isFinal, isImplementedInterface, isInnerClass, isInterface, isInterfaceOrAnnotation, isOuterClass, isPackageVisible, isPrivate, isProtected, isPublic, isRecord, isStandardClass, isStatic, isSynthetic, loadClass, loadClass, setClassfileVersion, setIsAnnotation, setIsInterface, setIsRecord, setModifiers, setReferencedClasses, setSourceFile, setTypeSignature, toStringMethods inherited from class ScanResultObject
findReferencedClassInfo, toString, toString, toStringWithSimpleNames
-
Field Details
-
arrayTypeSignature
The array type signature. -
elementClassInfo
The element class info.
-
-
Constructor Details
-
ArrayClassInfo
ArrayClassInfo()Default constructor for deserialization. -
ArrayClassInfo
ArrayClassInfo(ArrayTypeSignature arrayTypeSignature) Constructor.- Parameters:
arrayTypeSignature- the array type signature
-
-
Method Details
-
setScanResult
Description copied from class:ScanResultObjectSet ScanResult backreferences in info objects after scan has completed.- Overrides:
setScanResultin classClassInfo- Parameters:
scanResult- the scan result
-
getTypeSignatureStr
Get the raw type signature string of the array class, e.g. "[[I" for "int[][]".- Overrides:
getTypeSignatureStrin classClassInfo- Returns:
- The raw type signature string of the array class.
-
getTypeSignature
Returns null, because array classes do not have a ClassTypeSignature. CallgetArrayTypeSignature()instead.- Overrides:
getTypeSignaturein classClassInfo- Returns:
- null (always).
-
getArrayTypeSignature
Get the type signature of the class.- Returns:
- The class type signature, if available, otherwise returns null.
-
getElementTypeSignature
Get the type signature of the array elements.- Returns:
- The type signature of the array elements.
-
getNumDimensions
public int getNumDimensions()Get the number of dimensions of the array.- Returns:
- The number of dimensions of the array.
-
getElementClassInfo
-
loadElementClass
Get aClass<?>reference for the array element type. Causes the ClassLoader to load the element class, if it is not already loaded.- Parameters:
ignoreExceptions- Whether or not to ignore exceptions.- Returns:
- a
Class<?>reference for the 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.- Overrides:
loadClassin classClassInfo- 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.- Overrides:
loadClassin classClassInfo- Returns:
- The class reference.
- Throws:
IllegalArgumentException- if there were problems loading the class.
-
findReferencedClassInfo
protected void findReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, LogNode log) GetClassInfoobjects for any classes referenced in the type descriptor or type signature.- Overrides:
findReferencedClassInfoin classClassInfo- Parameters:
classNameToClassInfo- the map from class name toClassInfo.refdClassInfo- the referenced class infolog- the log
-
equals
-
hashCode
-