Package io.github.classgraph
Class ObjectTypedValueWrapper
java.lang.Object
io.github.classgraph.ScanResultObject
io.github.classgraph.ObjectTypedValueWrapper
A union type, used for typesafe serialization/deserialization to/from JSON. Only one field is ever set.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate AnnotationClassRef
Class ref.private AnnotationEnumValue
Enum value.private AnnotationInfo
AnnotationInfo.private boolean[]
Boolean array value.private Boolean
Boolean value.private byte[]
Byte array value.private Byte
Byte value.private Character
Character value.private char[]
Char array value.private double[]
Double array value.private Double
Double value.private float[]
Float array value.private Float
Float value.private int[]
Int array value.private Integer
Integer value.private long[]
Long array value.private Long
Long value.private ObjectTypedValueWrapper[]
Object array value.private short[]
Short array value.private Short
Short value.private String[]
String array value.private String
String value.Fields inherited from class io.github.classgraph.ScanResultObject
classRef, scanResult
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for deserialization.ObjectTypedValueWrapper
(Object annotationParamValue) Constructor. -
Method Summary
Modifier and TypeMethodDescription(package private) void
convertWrapperArraysToPrimitiveArrays
(ClassInfo annotationClassInfo, String paramName) Replace Object[] arrays containing boxed types with primitive arrays.boolean
protected void
findReferencedClassInfo
(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, LogNode log) GetClassInfo
objects for any classes referenced in annotation parameters.get()
Get the value wrapped by this wrapper class.private Object
getArrayValueClassOrName
(ClassInfo annotationClassInfo, String paramName, boolean getClass) Get the element type of an array element.protected ClassInfo
Get theClassInfo
object for the referenced class, or null if the referenced class was not encountered during scanning (i.e.protected String
The name of the class (used byScanResultObject.getClassInfo()
to fetch theClassInfo
object for the class).int
hashCode()
(package private) Object
instantiateOrGet
(ClassInfo annotationClassInfo, String paramName) Instantiate or get the wrapped value.(package private) void
setScanResult
(ScanResult scanResult) Set ScanResult backreferences in info objects after scan has completed.protected void
toString
(boolean useSimpleNames, StringBuilder buf) Render to string.Methods inherited from class io.github.classgraph.ScanResultObject
findReferencedClassInfo, loadClass, loadClass, loadClass, loadClass, toString, toString, toStringWithSimpleNames
-
Field Details
-
annotationEnumValue
Enum value. -
annotationClassRef
Class ref. -
annotationInfo
AnnotationInfo. -
stringValue
String value. -
integerValue
Integer value. -
longValue
Long value. -
shortValue
Short value. -
booleanValue
Boolean value. -
characterValue
Character value. -
floatValue
Float value. -
doubleValue
Double value. -
byteValue
Byte value. -
stringArrayValue
String array value. -
intArrayValue
private int[] intArrayValueInt array value. -
longArrayValue
private long[] longArrayValueLong array value. -
shortArrayValue
private short[] shortArrayValueShort array value. -
booleanArrayValue
private boolean[] booleanArrayValueBoolean array value. -
charArrayValue
private char[] charArrayValueChar array value. -
floatArrayValue
private float[] floatArrayValueFloat array value. -
doubleArrayValue
private double[] doubleArrayValueDouble array value. -
byteArrayValue
private byte[] byteArrayValueByte array value. -
objectArrayValue
Object array value.
-
-
Constructor Details
-
ObjectTypedValueWrapper
public ObjectTypedValueWrapper()Default constructor for deserialization. -
ObjectTypedValueWrapper
Constructor.- Parameters:
annotationParamValue
- annotation parameter value
-
-
Method Details
-
instantiateOrGet
Instantiate or get the wrapped value.- Parameters:
annotationClassInfo
- if non-null, instantiate this object as a parameter value of this annotation class.paramName
- if non-null, instantiate this object as a value of this named parameter.- Returns:
- The value wrapped by this wrapper class.
-
get
Get the value wrapped by this wrapper class.- Returns:
- The value wrapped by this wrapper class.
-
getArrayValueClassOrName
private Object getArrayValueClassOrName(ClassInfo annotationClassInfo, String paramName, boolean getClass) Get the element type of an array element.- Parameters:
annotationClassInfo
- annotation classparamName
- the parameter namegetClass
- If true, return aClass<?>
reference, otherwise return the class name.- Returns:
- the array value type as a
Class<?>
reference if getClass is true, otherwise the class name as a String.
-
convertWrapperArraysToPrimitiveArrays
Replace Object[] arrays containing boxed types with primitive arrays.- Parameters:
annotationClassInfo
- annotation class infoparamName
- the param name
-
getClassName
Description copied from class:ScanResultObject
The name of the class (used byScanResultObject.getClassInfo()
to fetch theClassInfo
object for the class).- Specified by:
getClassName
in classScanResultObject
- Returns:
- The class name.
-
getClassInfo
Description copied from class:ScanResultObject
Get theClassInfo
object for the referenced class, or null if the referenced class was not encountered during scanning (i.e. no ClassInfo object was created for the class during scanning). N.B. even if this method returns null,ScanResultObject.loadClass()
may be able to load the referenced class by name.- Overrides:
getClassInfo
in classScanResultObject
- Returns:
- The
ClassInfo
object for the referenced class.
-
setScanResult
Description copied from class:ScanResultObject
Set ScanResult backreferences in info objects after scan has completed.- Overrides:
setScanResult
in classScanResultObject
- Parameters:
scanResult
- the scan result
-
findReferencedClassInfo
protected void findReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, LogNode log) GetClassInfo
objects for any classes referenced in annotation parameters.- Overrides:
findReferencedClassInfo
in classScanResultObject
- Parameters:
classNameToClassInfo
- the map from class name toClassInfo
.refdClassInfo
- the referenced class infolog
- the log
-
hashCode
public int hashCode() -
equals
-
toString
Description copied from class:ScanResultObject
Render to string.- Specified by:
toString
in classScanResultObject
- Parameters:
useSimpleNames
- if true, use just the simple name of each class.buf
- the buf
-