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 AnnotationClassRefannotationClassRefClass ref.private AnnotationEnumValueannotationEnumValueEnum value.private AnnotationInfoannotationInfoAnnotationInfo.private boolean[]booleanArrayValueBoolean array value.private java.lang.BooleanbooleanValueBoolean value.private byte[]byteArrayValueByte array value.private java.lang.BytebyteValueByte value.private java.lang.CharactercharacterValueCharacter value.private char[]charArrayValueChar array value.private double[]doubleArrayValueDouble array value.private java.lang.DoubledoubleValueDouble value.private float[]floatArrayValueFloat array value.private java.lang.FloatfloatValueFloat value.private int[]intArrayValueInt array value.private java.lang.IntegerintegerValueInteger value.private long[]longArrayValueLong array value.private java.lang.LonglongValueLong value.private ObjectTypedValueWrapper[]objectArrayValueObject array value.private short[]shortArrayValueShort array value.private java.lang.ShortshortValueShort value.private java.lang.String[]stringArrayValueString array value.private java.lang.StringstringValueString 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) voidconvertWrapperArraysToPrimitiveArrays(ClassInfo annotationClassInfo, java.lang.String paramName)Replace Object[] arrays containing boxed types with primitive arrays.booleanequals(java.lang.Object other)protected voidfindReferencedClassInfo(java.util.Map<java.lang.String,ClassInfo> classNameToClassInfo, java.util.Set<ClassInfo> refdClassInfo, LogNode log)GetClassInfoobjects for any classes referenced in annotation parameters.java.lang.Objectget()Get the value wrapped by this wrapper class.private java.lang.ObjectgetArrayValueClassOrName(ClassInfo annotationClassInfo, java.lang.String paramName, boolean getClass)Get the element type of an array element.protected ClassInfogetClassInfo()Get theClassInfoobject for the referenced class, or null if the referenced class was not encountered during scanning (i.e.protected java.lang.StringgetClassName()The name of the class (used byScanResultObject.getClassInfo()to fetch theClassInfoobject for the class).inthashCode()(package private) java.lang.ObjectinstantiateOrGet(ClassInfo annotationClassInfo, java.lang.String paramName)Instantiate or get the wrapped value.(package private) voidsetScanResult(ScanResult scanResult)Set ScanResult backreferences in info objects after scan has completed.protected voidtoString(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:ScanResultObjectThe name of the class (used byScanResultObject.getClassInfo()to fetch theClassInfoobject for the class).- Specified by:
getClassNamein classScanResultObject- Returns:
- The class name.
-
getClassInfo
protected ClassInfo getClassInfo()
Description copied from class:ScanResultObjectGet theClassInfoobject 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:
getClassInfoin classScanResultObject- Returns:
- The
ClassInfoobject for the referenced class.
-
setScanResult
void setScanResult(ScanResult scanResult)
Description copied from class:ScanResultObjectSet ScanResult backreferences in info objects after scan has completed.- Overrides:
setScanResultin 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)
GetClassInfoobjects for any classes referenced in annotation parameters.- Overrides:
findReferencedClassInfoin classScanResultObject- Parameters:
classNameToClassInfo- the map from class name toClassInfo.refdClassInfo- the referenced class infolog- the log
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
toString
protected void toString(boolean useSimpleNames, java.lang.StringBuilder buf)Description copied from class:ScanResultObjectRender to string.- Specified by:
toStringin classScanResultObject- Parameters:
useSimpleNames- if true, use just the simple name of each class.buf- the buf
-
-