aboutsummaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
authorSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2017-12-15 00:16:10 +0300
committerSimon Ogorodnik <Simon.Ogorodnik@jetbrains.com>2018-07-13 18:24:47 +0300
commitd458983871a6fa6af10b86bc7529a8851a63b265 (patch)
tree440a68d1285068566ef434c909f93eaab1b0bf77 /core/src/main
parentdcd84d619665864b275591c93248f4637f6ee636 (diff)
downloaddokka-d458983871a6fa6af10b86bc7529a8851a63b265.tar.gz
dokka-d458983871a6fa6af10b86bc7529a8851a63b265.tar.bz2
dokka-d458983871a6fa6af10b86bc7529a8851a63b265.zip
[backport] Add class hierarchy for JLH
Original: 33426ea
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/kotlin/Model/DocumentationNode.kt6
1 files changed, 6 insertions, 0 deletions
diff --git a/core/src/main/kotlin/Model/DocumentationNode.kt b/core/src/main/kotlin/Model/DocumentationNode.kt
index da85cabf..897e3ad3 100644
--- a/core/src/main/kotlin/Model/DocumentationNode.kt
+++ b/core/src/main/kotlin/Model/DocumentationNode.kt
@@ -104,6 +104,12 @@ open class DocumentationNode(val name: String,
val platforms: List<String>
get() = references(RefKind.Platform).map { it.to.name }
+ val supertypes: List<DocumentationNode>
+ get() = references(RefKind.Superclass).map { it.to }
+
+ val superclass: DocumentationNode?
+ get() = supertypes.find { it.kind == NodeKind.Class }
+
// TODO: Should we allow node mutation? Model merge will copy by ref, so references are transparent, which could nice
fun addReferenceTo(to: DocumentationNode, kind: RefKind) {
references.add(DocumentationReference(this, to, kind))