Package io.github.classgraph
Class ObjectTypedValueWrapper
- java.lang.Object
-
- io.github.classgraph.ScanResultObject
-
- io.github.classgraph.ObjectTypedValueWrapper
-
class ObjectTypedValueWrapper extends ScanResultObject
A union type, used for typesafe serialization/deserialization to/from JSON. Only one field is ever set.
-
-
Field Summary
Fields Modifier and Type Field Description private AnnotationClassRef
annotationClassRef
Class ref.private AnnotationEnumValue
annotationEnumValue
Enum value.private AnnotationInfo
annotationInfo
AnnotationInfo.private boolean[]
booleanArrayValue
Boolean array value.private java.lang.Boolean
booleanValue
Boolean value.private byte[]
byteArrayValue
Byte array value.private java.lang.Byte
byteValue
Byte value.private java.lang.Character
characterValue
Character value.private char[]
charArrayValue
Char array value.private double[]
doubleArrayValue
Double array value.private java.lang.Double
doubleValue
Double value.private float[]
floatArrayValue
Float array value.private java.lang.Float
floatValue
Float value.private int[]
intArrayValue
Int array value.private java.lang.Integer
integerValue
Integer value.private long[]
longArrayValue
Long array value.private java.lang.Long
longValue
Long value.private ObjectTypedValueWrapper[]
objectArrayValue
Object array value.private short[]
shortArrayValue
Short array value.private java.lang.Short
shortValue
Short value.private java.lang.String[]
stringArrayValue
String array value.private java.lang.String
stringValue
String value.-
Fields inherited from class io.github.classgraph.ScanResultObject
classRef, scanResult
-
-
Constructor Summary
Constructors Constructor Description ObjectTypedValueWrapper()
Default constructor for deserialization.ObjectTypedValueWrapper(java.lang.Object annotationParamValue)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
convertWrapperArraysToPrimitiveArrays(ClassInfo annotationClassInfo, java.lang.String paramName)
Replace Object[] arrays containing boxed types with primitive arrays.boolean
equals(java.lang.Object other)
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 annotation parameters.java.lang.Object
get()
Get the value wrapped by this wrapper class.private java.lang.Object
getArrayValueClassOrName(ClassInfo annotationClassInfo, java.lang.String paramName, boolean getClass)
Get the element type of an array element.protected ClassInfo
getClassInfo()
Get theClassInfo
object for the referenced class, or null if the referenced class was not encountered during scanning (i.e.protected java.lang.String
getClassName()
The name of the class (used byScanResultObject.getClassInfo()
to fetch theClassInfo
object for the class).int
hashCode()
(package private) java.lang.Object
instantiateOrGet(ClassInfo annotationClassInfo, java.lang.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, java.lang.StringBuilder buf)
Render to string.-
Methods inherited from class io.github.classgraph.ScanResultObject
findReferencedClassInfo, loadClass, loadClass, loadClass, loadClass, toString, toString, toStringWithSimpleNames
-
-
-
-
Field Detail
-
annotationEnumValue
private AnnotationEnumValue annotationEnumValue
Enum value.
-
annotationClassRef
private AnnotationClassRef annotationClassRef
Class ref.
-
annotationInfo
private AnnotationInfo annotationInfo
AnnotationInfo.
-
stringValue
private java.lang.String stringValue
String value.
-
integerValue
private java.lang.Integer integerValue
Integer value.
-
longValue
private java.lang.Long longValue
Long value.
-
shortValue
private java.lang.Short shortValue
Short value.
-
booleanValue
private java.lang.Boolean booleanValue
Boolean value.
-
characterValue
private java.lang.Character characterValue
Character value.
-
floatValue
private java.lang.Float floatValue
Float value.
-
doubleValue
private java.lang.Double doubleValue
Double value.
-
byteValue
private java.lang.Byte byteValue
Byte value.
-
stringArrayValue
private java.lang.String[] stringArrayValue
String array value.
-
intArrayValue
private int[] intArrayValue
Int array value.
-
longArrayValue
private long[] longArrayValue
Long array value.
-
shortArrayValue
private short[] shortArrayValue
Short array value.
-
booleanArrayValue
private boolean[] booleanArrayValue
Boolean array value.
-
charArrayValue
private char[] charArrayValue
Char array value.
-
floatArrayValue
private float[] floatArrayValue
Float array value.
-
doubleArrayValue
private double[] doubleArrayValue
Double array value.
-
byteArrayValue
private byte[] byteArrayValue
Byte array value.
-
objectArrayValue
private ObjectTypedValueWrapper[] objectArrayValue
Object array value.
-
-
Method Detail
-
instantiateOrGet
java.lang.Object instantiateOrGet(ClassInfo annotationClassInfo, java.lang.String paramName)
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
public java.lang.Object get()
Get the value wrapped by this wrapper class.- Returns:
- The value wrapped by this wrapper class.
-
getArrayValueClassOrName
private java.lang.Object getArrayValueClassOrName(ClassInfo annotationClassInfo, java.lang.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
void convertWrapperArraysToPrimitiveArrays(ClassInfo annotationClassInfo, java.lang.String paramName)
Replace Object[] arrays containing boxed types with primitive arrays.- Parameters:
annotationClassInfo
- annotation class infoparamName
- the param name
-
getClassName
protected java.lang.String 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
protected ClassInfo 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
void setScanResult(ScanResult scanResult)
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(java.util.Map<java.lang.String,ClassInfo> classNameToClassInfo, java.util.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()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
toString
protected void toString(boolean useSimpleNames, java.lang.StringBuilder buf)
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
-
-