aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Model
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-09-26 00:32:08 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-09-26 00:32:08 +0300
commitf2bfbc788a995daed52d3c0d587223d7b21cb3cc (patch)
tree0f5e8f9394a2b3985d85313e7ab7a93d696f8b56 /core/src/main/kotlin/Model
parentc248ad0a18fe5744fba0a816286b2d6a8d67c76b (diff)
downloaddokka-f2bfbc788a995daed52d3c0d587223d7b21cb3cc.tar.gz
dokka-f2bfbc788a995daed52d3c0d587223d7b21cb3cc.tar.bz2
dokka-f2bfbc788a995daed52d3c0d587223d7b21cb3cc.zip
Refactor platforms & SinceKotlin logic
Diffstat (limited to 'core/src/main/kotlin/Model')
-rw-r--r--core/src/main/kotlin/Model/DocumentationNode.kt7
-rw-r--r--core/src/main/kotlin/Model/DocumentationReference.kt3
2 files changed, 9 insertions, 1 deletions
diff --git a/core/src/main/kotlin/Model/DocumentationNode.kt b/core/src/main/kotlin/Model/DocumentationNode.kt
index f2b3a937..5607c6d3 100644
--- a/core/src/main/kotlin/Model/DocumentationNode.kt
+++ b/core/src/main/kotlin/Model/DocumentationNode.kt
@@ -116,6 +116,13 @@ open class DocumentationNode(val name: String,
val externalType: DocumentationNode?
get() = references(RefKind.ExternalType).map { it.to }.firstOrNull()
+ var sinceKotlin: String?
+ get() = references(RefKind.SinceKotlin).singleOrNull()?.to?.name
+ set(value) {
+ if(value == null) return dropReferences { it.kind == RefKind.SinceKotlin }
+ append(DocumentationNode(value, Content.Empty, NodeKind.Value), RefKind.SinceKotlin)
+ }
+
val supertypes: List<DocumentationNode>
get() = details(NodeKind.Supertype)
diff --git a/core/src/main/kotlin/Model/DocumentationReference.kt b/core/src/main/kotlin/Model/DocumentationReference.kt
index e10796d2..1f2fc0c9 100644
--- a/core/src/main/kotlin/Model/DocumentationReference.kt
+++ b/core/src/main/kotlin/Model/DocumentationReference.kt
@@ -20,7 +20,8 @@ enum class RefKind {
TopLevelPage,
Platform,
ExternalType,
- Origin
+ Origin,
+ SinceKotlin
}
data class DocumentationReference(val from: DocumentationNode, val to: DocumentationNode, val kind: RefKind) {