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 Details

    • annotationEnumValue

      private AnnotationEnumValue annotationEnumValue
      Enum value.
    • annotationClassRef

      private AnnotationClassRef annotationClassRef
      Class ref.
    • annotationInfo

      private AnnotationInfo annotationInfo
      AnnotationInfo.
    • stringValue

      private String stringValue
      String value.
    • integerValue

      private Integer integerValue
      Integer value.
    • longValue

      private Long longValue
      Long value.
    • shortValue

      private Short shortValue
      Short value.
    • booleanValue

      private Boolean booleanValue
      Boolean value.
    • characterValue

      private Character characterValue
      Character value.
    • floatValue

      private Float floatValue
      Float value.
    • doubleValue

      private Double doubleValue
      Double value.
    • byteValue

      private Byte byteValue
      Byte value.
    • stringArrayValue

      private 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.
  • Constructor Details

    • ObjectTypedValueWrapper

      public ObjectTypedValueWrapper()
      Default constructor for deserialization.
    • ObjectTypedValueWrapper

      public ObjectTypedValueWrapper(Object annotationParamValue)
      Constructor.
      Parameters:
      annotationParamValue - annotation parameter value
  • Method Details

    • instantiateOrGet

      Object instantiateOrGet(ClassInfo annotationClassInfo, 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 Object 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 class
      paramName - the parameter name
      getClass - If true, return a Class<?> 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, String paramName)
      Replace Object[] arrays containing boxed types with primitive arrays.
      Parameters:
      annotationClassInfo - annotation class info
      paramName - the param name
    • getClassName

      protected String getClassName()
      Description copied from class: ScanResultObject
      The name of the class (used by ScanResultObject.getClassInfo() to fetch the ClassInfo object for the class).
      Specified by:
      getClassName in class ScanResultObject
      Returns:
      The class name.
    • getClassInfo

      protected ClassInfo getClassInfo()
      Description copied from class: ScanResultObject
      Get the ClassInfo 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 class ScanResultObject
      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 class ScanResultObject
      Parameters:
      scanResult - the scan result
    • findReferencedClassInfo

      protected void findReferencedClassInfo(Map<String,ClassInfo> classNameToClassInfo, Set<ClassInfo> refdClassInfo, LogNode log)
      Get ClassInfo objects for any classes referenced in annotation parameters.
      Overrides:
      findReferencedClassInfo in class ScanResultObject
      Parameters:
      classNameToClassInfo - the map from class name to ClassInfo.
      refdClassInfo - the referenced class info
      log - the log
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • toString

      protected void toString(boolean useSimpleNames, StringBuilder buf)
      Description copied from class: ScanResultObject
      Render to string.
      Specified by:
      toString in class ScanResultObject
      Parameters:
      useSimpleNames - if true, use just the simple name of each class.
      buf - the buf