KaAnnotationValue
Last modified: 23 July 2024KaAnnotationValue
represents the value of an annotation argument. Annotation values must be compile-time constants and can be of the following types:
Primitive Types: Includes
Int
,Long
,Short
,Byte
,Char
,Boolean
,Float
,Double
, and their unsigned counterparts.String: A string literal.
Enum Entry: A reference to an enum entry.
Class Reference: A reference to a class using the
::class
syntax.Annotation: A nested annotation call.
Array: An array of any of the above types.
Members
Subclasses
KaAnnotationValue.ConstantValue
Represents a constant value, e.g., "foo"
in @JvmName("foo")
.
KaAnnotationValue.EnumEntryValue
Represents a enum entry value, e.g., Color.RED
.
KaAnnotationValue.ClassLiteralValue
Represents a class literal value, e.g., String::class
or Array<String>::class
.
KaAnnotationValue.NestedAnnotationValue
Represents a nested annotation, e.g., ReplaceWith("bar()")
in @Deprecated("Use 'bar()' instead", ReplaceWith("bar()"))
.
KaAnnotationValue.ArrayValue
Represents an array of other annotation values, passed either as arrayOf(...)
or as a collection literal [...]
.
KaAnnotationValue.UnsupportedValue
Represents unsupported (invalid) expressions passed as annotation values.