[SLC] AnnotationsProvider: add kdoc

^KT-56046
This commit is contained in:
Dmitrii Gridin
2023-02-02 14:57:37 +01:00
committed by Space Team
parent 153ee3bc4b
commit 4e07210b9c
@@ -7,11 +7,37 @@ package org.jetbrains.kotlin.light.classes.symbol.annotations
import org.jetbrains.kotlin.analysis.api.annotations.KtAnnotationApplicationInfo
import org.jetbrains.kotlin.analysis.api.annotations.KtAnnotationApplicationWithArgumentsInfo
import org.jetbrains.kotlin.analysis.api.symbols.markers.KtAnnotatedSymbol
import org.jetbrains.kotlin.name.ClassId
/**
* This class provides annotations to [LazyAnnotationsBox].
*
* [EmptyAnnotationsProvider] is just an empty provider.
* [SymbolAnnotationsProvider] is a provider based on [KtAnnotatedSymbol] API.
* [CompositeAnnotationsProvider] is a composition of some [AnnotationsProvider].
*
* @see [LazyAnnotationsBox]
*/
internal sealed interface AnnotationsProvider {
/**
* @return a list of [KtAnnotationApplicationInfo] applicable for this provider
*/
fun annotationInfos(): List<KtAnnotationApplicationInfo>
operator fun get(classId: ClassId): Collection<KtAnnotationApplicationWithArgumentsInfo>
operator fun contains(classId: ClassId): Boolean
/**
* Example:
* ```
* package one
*
* @Ann1 @Ann2
* class Foo
* ```
* If this provider provides annotations from `Foo` class then the result of the function will be [ClassId] for `one.Foo`
*
* @return [ClassId] of an owner of annotations from this provider
*/
fun ownerClassId(): ClassId?
}