KaAnnotationList¶
@SubclassOptInRequired(markerClass = [KaImplementationDetail::class])
interface KaAnnotationList : List<KaAnnotation> , KaLifetimeOwner
A list of annotations applied to an entity.
Annotation owners usually implement KaAnnotated.
Properties¶
classIds¶
abstract val classIds: Collection<ClassId>
The list of ClassIds of all annotations, in their original order. If the entity has repeatable annotations, classIds may contain the same class ID multiple times.
To check if an annotation is present, use contains instead.
commonSupertype¶
context(session: KaSession)
val Iterable<KaType>.commonSupertype: KaType
The common supertype of the given KaTypes.
size¶
token¶
abstract val token: KaLifetimeToken
The KaLifetimeToken which determines the lifetime of the lifetime owner.
Functions¶
asCompositeScope¶
context(session: KaSession)
fun List<KaScope>.asCompositeScope(): KaScope
assertIsValidAndAccessible¶
inline fun KaLifetimeOwner.assertIsValidAndAccessible()
contains¶
abstract operator override fun contains(element: KaAnnotation): Boolean
Checks if the entity contains an annotation with the specified classId.
containsAll¶
abstract override fun containsAll(elements: Collection<KaAnnotation>): Boolean
get¶
abstract operator fun get(index: Int): KaAnnotation
abstract operator fun get(classId: ClassId): List<KaAnnotation>
Returns the list of annotations with the specified classId. The same type of annotation may occur multiple times if it is repeatable.
indexOf¶
abstract fun indexOf(element: KaAnnotation): Int
isEmpty¶
isValid¶
fun KaLifetimeOwner.isValid(): Boolean
Whether the lifetime owner is still valid, i.e. we are still in the scope of the lifetime owner's regular lifetime.
iterator¶
abstract operator override fun iterator(): Iterator<KaAnnotation>
lastIndexOf¶
abstract fun lastIndexOf(element: KaAnnotation): Int
listIterator¶
abstract fun listIterator(): ListIterator<KaAnnotation>
abstract fun listIterator(index: Int): ListIterator<KaAnnotation>
subList¶
abstract fun subList(fromIndex: Int, toIndex: Int): List<KaAnnotation>
withValidityAssertion¶
inline fun <R> KaLifetimeOwner.withValidityAssertion(action: () -> R): R
Executes action only if the KaLifetimeOwner is still valid and accessible. Otherwise, throws a validity exception based on the concrete violation.