org.jetbrains.dokka.base.signatures.JvmSignatureUtils.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of dokka-base Show documentation
Show all versions of dokka-base Show documentation
Dokka is an API documentation engine for Kotlin
The newest version!
/*
* Copyright 2014-2024 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
package org.jetbrains.dokka.base.signatures
import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
import org.jetbrains.dokka.base.signatures.KotlinSignatureUtils.drisOfAllNestedBounds
import org.jetbrains.dokka.base.translators.documentables.PageContentBuilder
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.*
import org.jetbrains.dokka.model.AnnotationTarget
import org.jetbrains.dokka.model.properties.WithExtraProperties
import org.jetbrains.dokka.pages.*
public interface JvmSignatureUtils {
public fun PageContentBuilder.DocumentableContentBuilder.annotationsBlock(d: AnnotationTarget)
public fun PageContentBuilder.DocumentableContentBuilder.annotationsInline(d: AnnotationTarget)
public fun WithExtraProperties.modifiers(): SourceSetDependent>
public fun Annotations.Annotation.isIgnored(): Boolean
public fun Collection.toSignatureString(): String =
joinToString("") { it.name.toLowerCase() + " " }
@Suppress("UNCHECKED_CAST")
public fun Documentable.annotations(): Map> {
return (this as? WithExtraProperties)?.annotations() ?: emptyMap()
}
public fun WithExtraProperties.annotations(): SourceSetDependent> =
extra[Annotations]?.directAnnotations ?: emptyMap()
@Suppress("UNCHECKED_CAST")
public operator fun > SourceSetDependent.plus(other: SourceSetDependent): SourceSetDependent {
return LinkedHashMap(this).apply {
for ((k, v) in other) {
put(k, get(k).let { if (it != null) (it + v) as T else v })
}
}
}
public fun DProperty.annotations(): SourceSetDependent> {
return (extra[Annotations]?.directAnnotations ?: emptyMap()) +
(getter?.annotations() ?: emptyMap()).mapValues { it.value.map { it.copy( scope = Annotations.AnnotationScope.GETTER) } } +
(setter?.annotations() ?: emptyMap()).mapValues { it.value.map { it.copy( scope = Annotations.AnnotationScope.SETTER) } }
}
private fun PageContentBuilder.DocumentableContentBuilder.annotations(
d: AnnotationTarget,
ignored: Set,
styles: Set