Package io.github.classgraph
Class ArrayTypeSignature
- java.lang.Object
-
- io.github.classgraph.HierarchicalTypeSignature
-
- io.github.classgraph.TypeSignature
-
- io.github.classgraph.ReferenceTypeSignature
-
- io.github.classgraph.ArrayTypeSignature
-
public class ArrayTypeSignature extends ReferenceTypeSignature
An array type signature.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Class<?>
classRef
The class ref, once the class is loaded.protected ScanResult
scanResult
The scan result.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
boolean
equalsIgnoringTypeParams(TypeSignature other)
Compare base types, ignoring generic type parameters.protected void
findReferencedClassNames(java.util.Set<java.lang.String> refdClassNames)
Get the names of any classes referenced in the type signature.ArrayClassInfo
getArrayClassInfo()
Return anArrayClassInfo
instance for the array class, cast to its superclass.protected ClassInfo
getClassInfo()
protected java.lang.String
getClassName()
The name of the class (used bygetClassInfo()
to fetch theClassInfo
object for the class).TypeSignature
getElementTypeSignature()
Get the type signature of the array elements.int
getNumDimensions()
Get the number of dimensions of the array.java.lang.String
getTypeSignatureStr()
Get the raw array type signature string, e.g.int
hashCode()
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.protected java.lang.String
toStringInternal(boolean useSimpleNames)
TypeSignature.toString()
method, possibly returning simple names for classes (i.e.-
Methods inherited from class io.github.classgraph.TypeSignature
findReferencedClassInfo, toString, toStringWithSimpleNames
-
-
-
-
Field Detail
-
scanResult
protected transient ScanResult scanResult
The scan result.
-
classRef
protected transient java.lang.Class<?> classRef
The class ref, once the class is loaded.
-
-
Method Detail
-
getTypeSignatureStr
public java.lang.String getTypeSignatureStr()
Get the raw array type signature string, e.g. "[[I".- Returns:
- the raw array type signature string.
-
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.
-
getClassName
protected java.lang.String getClassName()
The name of the class (used bygetClassInfo()
to fetch theClassInfo
object for the class).- Returns:
- The class name.
-
getClassInfo
protected ClassInfo getClassInfo()
-
getArrayClassInfo
public ArrayClassInfo getArrayClassInfo()
Return anArrayClassInfo
instance for the array class, cast to its superclass.- Returns:
- the
ArrayClassInfo
instance.
-
findReferencedClassNames
protected void findReferencedClassNames(java.util.Set<java.lang.String> refdClassNames)
Get the names of any classes referenced in the type signature.- Overrides:
findReferencedClassNames
in classTypeSignature
- Parameters:
refdClassNames
- the referenced class names.
-
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.- 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.- Returns:
- The class reference.
- Throws:
java.lang.IllegalArgumentException
- if there were problems loading the class.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
equalsIgnoringTypeParams
public boolean equalsIgnoringTypeParams(TypeSignature other)
Description copied from class:TypeSignature
Compare base types, ignoring generic type parameters.- Specified by:
equalsIgnoringTypeParams
in classTypeSignature
- Parameters:
other
- the otherTypeSignature
to compare to.- Returns:
- True if the two
TypeSignature
objects are equal, ignoring type parameters.
-
toStringInternal
protected java.lang.String toStringInternal(boolean useSimpleNames)
Description copied from class:TypeSignature
TypeSignature.toString()
method, possibly returning simple names for classes (i.e. if useSimpleNames is true, the package names of classes are stripped).- Specified by:
toStringInternal
in classTypeSignature
- Parameters:
useSimpleNames
- whether or not to use simple names for classes.- Returns:
- the string representation of the type signature, with package names stripped.
-
-