Top Description Fields Constructors Methods
io.github.classgraph

pack-priv Class ObjectTypedValueWrapper

extends ScanResultObject
Class Inheritance
Imports
java.lang.reflect.Array, java.util.Arrays, .Map, .Objects, .Set, nonapi.io.github.classgraph.utils.LogNode

A union type, used for typesafe serialization/deserialization to/from JSON. Only one field is ever set.

Field Summary

Modifier and TypeField and Description
private AnnotationClassRef
private AnnotationEnumValue
private AnnotationInfo
annotationInfo

AnnotationInfo.

private boolean[]
booleanArrayValue

Boolean array value.

private Boolean
booleanValue

Boolean value.

private byte[]
byteArrayValue

Byte array value.

private Byte
byteValue

Byte value.

private Character
characterValue

Character value.

private char[]
charArrayValue

Char array value.

private double[]
doubleArrayValue

Double array value.

private Double
doubleValue

Double value.

private float[]
floatArrayValue

Float array value.

private Float
floatValue

Float value.

private int[]
intArrayValue

Int array value.

private Integer
integerValue

Integer value.

private long[]
longArrayValue

Long array value.

private Long
longValue

Long value.

private ObjectTypedValueWrapper[]
objectArrayValue

Object array value.

private short[]
shortArrayValue

Short array value.

private Short
shortValue

Short value.

private String[]
stringArrayValue

String array value.

private String
stringValue

String value.

Inherited from io.github.classgraph.ScanResultObject:
classRefscanResult

Constructor Summary

AccessConstructor and Description
public
ObjectTypedValueWrapper()

Default constructor for deserialization.

public
ObjectTypedValueWrapper(final Object
annotation parameter value
annotationParamValue
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
pack-priv void
convertWrapperArraysToPrimitiveArrays(final ClassInfo
annotation class info
annotationClassInfo
,
final String
the param name
paramName
)

Replace Object[] arrays containing boxed types with primitive arrays.

public boolean
equals(final Object
the reference object with which to compare.
other
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

protected void
findReferencedClassInfo(final Map<String, ClassInfo>
the map from class name to ClassInfo.
classNameToClassInfo
,
final Set<ClassInfo>
the referenced class info
refdClassInfo
,
final LogNode
the log
log
)

Overrides io.github.classgraph.ScanResultObject.findReferencedClassInfo.

Get ClassInfo objects for any classes referenced in annotation parameters.

public Object

Returns:

The value wrapped by this wrapper class.
get
()

Get the value wrapped by this wrapper class.

private Object

Returns:

the array value type as a Class<?> reference if getClass is true, otherwise the class name as a String.
getArrayValueClassOrName
(final ClassInfo
annotation class
annotationClassInfo
,
final String
the parameter name
paramName
,
final boolean
If true, return a Class<?> reference, otherwise return the class name.
getClass
)

Get the element type of an array element.

protected ClassInfo
getClassInfo()

Overrides io.github.classgraph.ScanResultObject.getClassInfo.

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).

protected String
getClassName()

Implements abstract io.github.classgraph.ScanResultObject.getClassName.

The name of the class (used by getClassInfo() to fetch the ClassInfo object for the class).

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

pack-priv Object

Returns:

The value wrapped by this wrapper class.
instantiateOrGet
(final ClassInfo
if non-null, instantiate this object as a parameter value of this annotation class.
annotationClassInfo
,
final String
if non-null, instantiate this object as a value of this named parameter.
paramName
)

Instantiate or get the wrapped value.

pack-priv void
setScanResult(final ScanResult
the scan result
scanResult
)

Overrides io.github.classgraph.ScanResultObject.setScanResult.

Set ScanResult backreferences in info objects after scan has completed.

protected void
toString(final boolean
if true, use just the simple name of each class.
useSimpleNames
,
final StringBuilder
the buf
buf
)

Implements abstract io.github.classgraph.ScanResultObject.toString.

Render to string.

Inherited from io.github.classgraph.ScanResultObject:
findReferencedClassInfoloadClassloadClassloadClassloadClasstoStringtoStringtoStringWithSimpleNames

Field Detail

annotationClassRefback to summary
private AnnotationClassRef annotationClassRef

Class ref.

annotationEnumValueback to summary
private AnnotationEnumValue annotationEnumValue

Enum value.

annotationInfoback to summary
private AnnotationInfo annotationInfo

AnnotationInfo.

booleanArrayValueback to summary
private boolean[] booleanArrayValue

Boolean array value.

booleanValueback to summary
private Boolean booleanValue

Boolean value.

byteArrayValueback to summary
private byte[] byteArrayValue

Byte array value.

byteValueback to summary
private Byte byteValue

Byte value.

characterValueback to summary
private Character characterValue

Character value.

charArrayValueback to summary
private char[] charArrayValue

Char array value.

doubleArrayValueback to summary
private double[] doubleArrayValue

Double array value.

doubleValueback to summary
private Double doubleValue

Double value.

floatArrayValueback to summary
private float[] floatArrayValue

Float array value.

floatValueback to summary
private Float floatValue

Float value.

intArrayValueback to summary
private int[] intArrayValue

Int array value.

integerValueback to summary
private Integer integerValue

Integer value.

longArrayValueback to summary
private long[] longArrayValue

Long array value.

longValueback to summary
private Long longValue

Long value.

objectArrayValueback to summary
private ObjectTypedValueWrapper[] objectArrayValue

Object array value.

shortArrayValueback to summary
private short[] shortArrayValue

Short array value.

shortValueback to summary
private Short shortValue

Short value.

stringArrayValueback to summary
private String[] stringArrayValue

String array value.

stringValueback to summary
private String stringValue

String value.

Constructor Detail

ObjectTypedValueWrapperback to summary
public ObjectTypedValueWrapper()

Default constructor for deserialization.

ObjectTypedValueWrapperback to summary
public ObjectTypedValueWrapper(final Object annotationParamValue)

Constructor.

Parameters
annotationParamValue:Object

annotation parameter value

Method Detail

convertWrapperArraysToPrimitiveArraysback to summary
pack-priv void convertWrapperArraysToPrimitiveArrays(final ClassInfo annotationClassInfo, final String paramName)

Replace Object[] arrays containing boxed types with primitive arrays.

Parameters
annotationClassInfo:ClassInfo

annotation class info

paramName:String

the param name

equalsback to summary
public boolean equals(final Object other)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
other:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
findReferencedClassInfoback to summary
protected void findReferencedClassInfo(final Map<String, ClassInfo> classNameToClassInfo, final Set<ClassInfo> refdClassInfo, final LogNode log)

Overrides io.github.classgraph.ScanResultObject.findReferencedClassInfo.

Get ClassInfo objects for any classes referenced in annotation parameters.

Parameters
classNameToClassInfo:Map<String, ClassInfo>

the map from class name to ClassInfo.

refdClassInfo:Set<ClassInfo>

the referenced class info

log:LogNode

Doc from io.github.classgraph.ScanResultObject.findReferencedClassInfo.

the log

Annotations
@Override
getback to summary
public Object get()

Get the value wrapped by this wrapper class.

Returns:Object

The value wrapped by this wrapper class.

getArrayValueClassOrNameback to summary
private Object getArrayValueClassOrName(final ClassInfo annotationClassInfo, final String paramName, final boolean getClass)

Get the element type of an array element.

Parameters
annotationClassInfo:ClassInfo

annotation class

paramName:String

the parameter name

getClass:boolean

If true, return a Class<?> reference, otherwise return the class name.

Returns:Object

the array value type as a Class<?> reference if getClass is true, otherwise the class name as a String.

getClassInfoback to summary
protected ClassInfo getClassInfo()

Overrides io.github.classgraph.ScanResultObject.getClassInfo.

Doc from io.github.classgraph.ScanResultObject.getClassInfo.

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, loadClass() may be able to load the referenced class by name.

Returns:ClassInfo

The ClassInfo object for the referenced class.

Annotations
@Override
getClassNameback to summary
protected String getClassName()

Implements abstract io.github.classgraph.ScanResultObject.getClassName.

Doc from io.github.classgraph.ScanResultObject.getClassName.

The name of the class (used by getClassInfo() to fetch the ClassInfo object for the class).

Returns:String

The class name.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
instantiateOrGetback to summary
pack-priv Object instantiateOrGet(final ClassInfo annotationClassInfo, final String paramName)

Instantiate or get the wrapped value.

Parameters
annotationClassInfo:ClassInfo

if non-null, instantiate this object as a parameter value of this annotation class.

paramName:String

if non-null, instantiate this object as a value of this named parameter.

Returns:Object

The value wrapped by this wrapper class.

setScanResultback to summary
pack-priv void setScanResult(final ScanResult scanResult)

Overrides io.github.classgraph.ScanResultObject.setScanResult.

Doc from io.github.classgraph.ScanResultObject.setScanResult.

Set ScanResult backreferences in info objects after scan has completed.

Parameters
scanResult:ScanResult

the scan result

Annotations
@Override
toStringback to summary
protected void toString(final boolean useSimpleNames, final StringBuilder buf)

Implements abstract io.github.classgraph.ScanResultObject.toString.

Doc from io.github.classgraph.ScanResultObject.toString.

Render to string.

Parameters
useSimpleNames:boolean

if true, use just the simple name of each class.

buf:StringBuilder

the buf

Annotations
@Override