KaAnnotationValue
KaAnnotationValue 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
::classsyntax.Annotation: A nested annotation call.
Array: An array of any of the above types.
Members
val sourcePsi: KtElement?The annotation value
PsiElement. Only defined for annotations in source files, for libraries it always returnsnull.
Subclasses
KaAnnotationValue.ConstantValue
Represents a constant value, e.g., "foo" in @JvmName("foo").
val value: KaConstantValueA constant value (a number,
Boolean,Char, or aString, wrapped into aKaConstantValueabstraction).
KaAnnotationValue.EnumEntryValue
Represents a enum entry value, e.g., Color.RED.
val callableId: CallableId?The enum entry name.
KaAnnotationValue.ClassLiteralValue
Represents a class literal value, e.g., String::class or Array<String>::class.
public val type: KaTypeThe class reference type.
KaAnnotationValue.NestedAnnotationValue
Represents a nested annotation, e.g., ReplaceWith("bar()") in @Deprecated("Use 'bar()' instead", ReplaceWith("bar()")).
val annotation: KaAnnotationThe nested annotation.
KaAnnotationValue.ArrayValue
Represents an array of other annotation values, passed either as arrayOf(...) or as a collection literal [...].
val values: Collection<KaAnnotationValue>A list of annotation values inside the array.
KaAnnotationValue.UnsupportedValue
Represents unsupported (invalid) expressions passed as annotation values.