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 AnnotationClassRefClass ref.private AnnotationEnumValueEnum value.private AnnotationInfoAnnotationInfo.private boolean[]Boolean array value.private BooleanBoolean value.private byte[]Byte array value.private ByteByte value.private CharacterCharacter value.private char[]Char array value.private double[]Double array value.private DoubleDouble value.private float[]Float array value.private FloatFloat value.private int[]Int array value.private IntegerInteger value.private long[]Long array value.private LongLong value.private ObjectTypedValueWrapper[]Object array value.private short[]Short array value.private ShortShort value.private String[]String array value.private StringString 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) voidconvertWrapperArraysToPrimitiveArrays(ClassInfo annotationClassInfo, String paramName) Replace Object[] arrays containing boxed types with primitive arrays.booleanprotected voidfindReferencedClassInfo(Map<String, ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, LogNode log) GetClassInfoobjects for any classes referenced in annotation parameters.get()Get the value wrapped by this wrapper class.private ObjectgetArrayValueClassOrName(ClassInfo annotationClassInfo, String paramName, boolean getClass) Get the element type of an array element.protected ClassInfoGet theClassInfoobject for the referenced class, or null if the referenced class was not encountered during scanning (i.e.protected StringThe name of the class (used byScanResultObject.getClassInfo()to fetch theClassInfoobject for the class).inthashCode()(package private) ObjectinstantiateOrGet(ClassInfo annotationClassInfo, 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, 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:ScanResultObjectThe name of the class (used byScanResultObject.getClassInfo()to fetch theClassInfoobject for the class).- Specified by:
getClassNamein classScanResultObject- Returns:
- The class name.
-
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
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(Map<String, ClassInfo> classNameToClassInfo, 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() -
equals
-
toString
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
-