aboutsummaryrefslogtreecommitdiff
path: root/src/Model/DocumentationReference.kt
blob: 4bc819f66a495dcee5f9830e956b8f785f625c95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package org.jetbrains.dokka

public data class DocumentationReference(val from: DocumentationNode, val to: DocumentationNode, val kind: DocumentationReference.Kind) {
    public enum class Kind {
        Owner
        Member
        Detail
        Link
        Extension
        Inheritor
        Override
        Annotation
        Deprecation
        TopLevelPage
    }
}

class PendingDocumentationReference(val lazyNodeFrom: () -> DocumentationNode?,
                                    val lazyNodeTo: () -> DocumentationNode?,
                                    val kind: DocumentationReference.Kind) {
    fun resolve() {
        val fromNode = lazyNodeFrom()
        val toNode = lazyNodeTo()
        if (fromNode != null && toNode != null) {
            fromNode.addReferenceTo(toNode, kind)
        }
    }
}