All Downloads are FREE. Search and download functionalities are using the official Maven repository.

model.documentableProperties.kt Maven / Gradle / Ivy

Go to download

Dokka is an API documentation engine for Kotlin and Java, performing the same function as Javadoc for Java

There is a newer version: 2.0.0
Show newest version
package org.jetbrains.dokka.model

import org.jetbrains.dokka.DokkaConfiguration.DokkaSourceSet
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.properties.ExtraProperty
import org.jetbrains.dokka.model.properties.MergeStrategy

data class InheritedMember(val inheritedFrom: SourceSetDependent) : ExtraProperty {
    companion object : ExtraProperty.Key {
        override fun mergeStrategyFor(left: InheritedMember, right: InheritedMember) = MergeStrategy.Replace(
            InheritedMember(left.inheritedFrom + right.inheritedFrom)
        )
    }

    fun isInherited(sourceSetDependent: DokkaSourceSet): Boolean = inheritedFrom[sourceSetDependent] != null

    override val key: ExtraProperty.Key = InheritedMember
}

data class ImplementedInterfaces(val interfaces: SourceSetDependent>) : ExtraProperty {
    companion object : ExtraProperty.Key {
        override fun mergeStrategyFor(left: ImplementedInterfaces, right: ImplementedInterfaces) =
            MergeStrategy.Replace(ImplementedInterfaces(left.interfaces + right.interfaces))
    }

    override val key: ExtraProperty.Key = ImplementedInterfaces
}

data class ExceptionInSupertypes(val exceptions: SourceSetDependent>): ExtraProperty {
    companion object : ExtraProperty.Key {
        override fun mergeStrategyFor(left: ExceptionInSupertypes, right: ExceptionInSupertypes) =
            MergeStrategy.Replace(ExceptionInSupertypes(left.exceptions + right.exceptions))
    }

    override val key: ExtraProperty.Key = ExceptionInSupertypes
}

object ObviousMember : ExtraProperty, ExtraProperty.Key {
    override val key: ExtraProperty.Key = this
}

/**
 * Whether this [DProperty] is `var` or `val`, should be present both in Kotlin and in Java properties
 *
 * In case of properties that came from `Java`, [IsVar] is added if
 * the java field has no accessors at all (plain field) or has a setter
 */
object IsVar : ExtraProperty, ExtraProperty.Key {
    override val key: ExtraProperty.Key = this
}

data class CheckedExceptions(val exceptions: SourceSetDependent>) : ExtraProperty, ExtraProperty.Key {
    companion object : ExtraProperty.Key {
        override fun mergeStrategyFor(left: CheckedExceptions, right: CheckedExceptions) =
            MergeStrategy.Replace(CheckedExceptions(left.exceptions + right.exceptions))
    }
    override val key: ExtraProperty.Key = CheckedExceptions
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy