Package io.github.classgraph
Class ArrayClassInfo
- java.lang.Object
-
- io.github.classgraph.ScanResultObject
-
- io.github.classgraph.ClassInfo
-
- io.github.classgraph.ArrayClassInfo
-
public class ArrayClassInfo extends ClassInfo
Holds metadata about an array class. This class extendsClassInfo
with additional methods relevant to array classes, in particulargetArrayTypeSignature()
,getTypeSignatureStr()
,getElementTypeSignature()
,getElementClassInfo()
,loadElementClass()
, andgetNumDimensions()
.An
ArrayClassInfo
object will not have any methods, fields or annotations.ClassInfo.isArrayClass()
will return true for this subclass ofClassInfo
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class io.github.classgraph.ClassInfo
ClassInfo.ReachableAndDirectlyRelatedClasses, ClassInfo.RelType
-
-
Field Summary
Fields Modifier and Type Field Description private ArrayTypeSignature
arrayTypeSignature
The array type signature.private ClassInfo
elementClassInfo
The element class info.-
Fields inherited from class io.github.classgraph.ClassInfo
annotationDefaultParamValues, annotationDefaultParamValuesHasBeenConvertedToPrimitive, annotationInfo, classfileResource, classLoader, classpathElement, fieldInfo, isExternalClass, isInherited, isScannedClass, methodInfo, moduleInfo, name, packageInfo, typeAnnotationDecorators, typeSignatureStr
-
Fields inherited from class io.github.classgraph.ScanResultObject
classRef, scanResult
-
-
Constructor Summary
Constructors Constructor Description ArrayClassInfo()
Default constructor for deserialization.ArrayClassInfo(ArrayTypeSignature arrayTypeSignature)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Use class name for equals().protected void
findReferencedClassInfo(java.util.Map<java.lang.String,ClassInfo> classNameToClassInfo, java.util.Set<ClassInfo> refdClassInfo, LogNode log)
GetClassInfo
objects for any classes referenced in the type descriptor or type signature.ArrayTypeSignature
getArrayTypeSignature()
Get the type signature of the class.ClassInfo
getElementClassInfo()
Get theClassInfo
instance for the array element type.TypeSignature
getElementTypeSignature()
Get the type signature of the array elements.int
getNumDimensions()
Get the number of dimensions of the array.ClassTypeSignature
getTypeSignature()
Returns null, because array classes do not have a ClassTypeSignature.java.lang.String
getTypeSignatureStr()
Get the raw type signature string of the array class, e.g.int
hashCode()
Use hash code of class name.java.lang.Class<?>
loadClass()
Obtain aClass<?>
reference for the array class named by thisArrayClassInfo
object.java.lang.Class<?>
loadClass(boolean ignoreExceptions)
Obtain aClass<?>
reference for the array class named by thisArrayClassInfo
object.java.lang.Class<?>
loadElementClass()
Get aClass<?>
reference for the array element type.java.lang.Class<?>
loadElementClass(boolean ignoreExceptions)
Get aClass<?>
reference for the array element type.(package private) void
setScanResult(ScanResult scanResult)
Set ScanResult backreferences in info objects after scan has completed.-
Methods inherited from class io.github.classgraph.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, toString
-
Methods inherited from class io.github.classgraph.ScanResultObject
findReferencedClassInfo, toString, toString, toStringWithSimpleNames
-
-
-
-
Field Detail
-
arrayTypeSignature
private ArrayTypeSignature arrayTypeSignature
The array type signature.
-
elementClassInfo
private ClassInfo elementClassInfo
The element class info.
-
-
Constructor Detail
-
ArrayClassInfo
ArrayClassInfo()
Default constructor for deserialization.
-
ArrayClassInfo
ArrayClassInfo(ArrayTypeSignature arrayTypeSignature)
Constructor.- Parameters:
arrayTypeSignature
- the array type signature
-
-
Method Detail
-
setScanResult
void setScanResult(ScanResult scanResult)
Description copied from class:ScanResultObject
Set ScanResult backreferences in info objects after scan has completed.- Overrides:
setScanResult
in classClassInfo
- Parameters:
scanResult
- the scan result
-
getTypeSignatureStr
public java.lang.String getTypeSignatureStr()
Get the raw type signature string of the array class, e.g. "[[I" for "int[][]".- Overrides:
getTypeSignatureStr
in classClassInfo
- Returns:
- The raw type signature string of the array class.
-
getTypeSignature
public ClassTypeSignature getTypeSignature()
Returns null, because array classes do not have a ClassTypeSignature. CallgetArrayTypeSignature()
instead.- Overrides:
getTypeSignature
in classClassInfo
- Returns:
- null (always).
-
getArrayTypeSignature
public ArrayTypeSignature getArrayTypeSignature()
Get the type signature of the class.- Returns:
- The class type signature, if available, otherwise returns null.
-
getElementTypeSignature
public TypeSignature 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
public ClassInfo getElementClassInfo()
Get theClassInfo
instance for the array element type.- Returns:
- the
ClassInfo
instance for the array element type. Returns null if the element type was not found during the scan. In particular, will return null for arrays that have a primitive element type.
-
loadElementClass
public java.lang.Class<?> loadElementClass(boolean ignoreExceptions)
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
public java.lang.Class<?> 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
public java.lang.Class<?> loadClass(boolean ignoreExceptions)
Obtain aClass<?>
reference for the array class named by thisArrayClassInfo
object. Causes the ClassLoader to load the element class, if it is not already loaded.- Overrides:
loadClass
in 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:
java.lang.IllegalArgumentException
- if ignoreExceptions is false and there were problems loading the class.
-
loadClass
public java.lang.Class<?> loadClass()
Obtain aClass<?>
reference for the array class named by thisArrayClassInfo
object. Causes the ClassLoader to load the element class, if it is not already loaded.
-
findReferencedClassInfo
protected void findReferencedClassInfo(java.util.Map<java.lang.String,ClassInfo> classNameToClassInfo, java.util.Set<ClassInfo> refdClassInfo, LogNode log)
GetClassInfo
objects for any classes referenced in the type descriptor or type signature.- Overrides:
findReferencedClassInfo
in classClassInfo
- Parameters:
classNameToClassInfo
- the map from class name toClassInfo
.refdClassInfo
- the referenced class infolog
- the log
-
equals
public boolean equals(java.lang.Object obj)
Description copied from class:ClassInfo
Use class name for equals().
-
-