aboutsummaryrefslogtreecommitdiff
path: root/core/src/main
diff options
context:
space:
mode:
authorAndrzej Ratajczak <andrzej.ratajczak98@gmail.com>2020-09-14 13:49:54 +0200
committerKamil Doległo <9080183+kamildoleglo@users.noreply.github.com>2020-10-07 02:36:57 +0200
commitec637955575995011351b106d3a67194d21c4b15 (patch)
tree5762d6ca0c49cc48dec01240380bc6fd436e81b0 /core/src/main
parent7c4301a48af55e156538666b6e645d8d13caae9a (diff)
downloaddokka-ec637955575995011351b106d3a67194d21c4b15.tar.gz
dokka-ec637955575995011351b106d3a67194d21c4b15.tar.bz2
dokka-ec637955575995011351b106d3a67194d21c4b15.zip
Introduce top-level DocTag
Diffstat (limited to 'core/src/main')
-rw-r--r--core/src/main/kotlin/model/doc/DocTag.kt3
-rw-r--r--core/src/main/kotlin/model/doc/TagWrapper.kt48
2 files changed, 21 insertions, 30 deletions
diff --git a/core/src/main/kotlin/model/doc/DocTag.kt b/core/src/main/kotlin/model/doc/DocTag.kt
index b2530ca6..04b5c913 100644
--- a/core/src/main/kotlin/model/doc/DocTag.kt
+++ b/core/src/main/kotlin/model/doc/DocTag.kt
@@ -51,7 +51,8 @@ data class CodeBlock(
data class CustomDocTag(
override val children: List<DocTag> = emptyList(),
- override val params: Map<String, String> = emptyMap()
+ override val params: Map<String, String> = emptyMap(),
+ val name: String
) : DocTag()
data class Dd(
diff --git a/core/src/main/kotlin/model/doc/TagWrapper.kt b/core/src/main/kotlin/model/doc/TagWrapper.kt
index d9b08f2c..cfe99b1e 100644
--- a/core/src/main/kotlin/model/doc/TagWrapper.kt
+++ b/core/src/main/kotlin/model/doc/TagWrapper.kt
@@ -3,38 +3,28 @@ package org.jetbrains.dokka.model.doc
import org.jetbrains.dokka.links.DRI
import org.jetbrains.dokka.model.WithChildren
-sealed class TagWrapper(val root: DocTag) : WithChildren<DocTag> {
-
+sealed class TagWrapper : WithChildren<DocTag> {
+ abstract val root: DocTag
override val children: List<DocTag>
get() = root.children
-
- override fun equals(other: Any?): Boolean =
- (
- other != null &&
- this::class == other::class &&
- this.root == (other as TagWrapper).root
- )
-
- override fun hashCode(): Int = root.hashCode()
}
-sealed class NamedTagWrapper(root: DocTag, val name: String) : TagWrapper(root) {
- override fun equals(other: Any?): Boolean = super.equals(other) && this.name == (other as NamedTagWrapper).name
- override fun hashCode(): Int = super.hashCode() + name.hashCode()
+sealed class NamedTagWrapper : TagWrapper() {
+ abstract val name: String
}
-class Description(root: DocTag) : TagWrapper(root)
-class Author(root: DocTag) : TagWrapper(root)
-class Version(root: DocTag) : TagWrapper(root)
-class Since(root: DocTag) : TagWrapper(root)
-class See(root: DocTag, name: String, val address: DRI?) : NamedTagWrapper(root, name)
-class Param(root: DocTag, name: String) : NamedTagWrapper(root, name)
-class Return(root: DocTag) : TagWrapper(root)
-class Receiver(root: DocTag) : TagWrapper(root)
-class Constructor(root: DocTag) : TagWrapper(root)
-class Throws(root: DocTag, name: String) : NamedTagWrapper(root, name)
-class Sample(root: DocTag, name: String) : NamedTagWrapper(root, name)
-class Deprecated(root: DocTag) : TagWrapper(root)
-class Property(root: DocTag, name: String) : NamedTagWrapper(root, name)
-class Suppress(root: DocTag) : TagWrapper(root)
-class CustomTagWrapper(root: DocTag, name: String) : NamedTagWrapper(root, name)
+data class Description(override val root: DocTag) : TagWrapper()
+data class Author(override val root: DocTag) : TagWrapper()
+data class Version(override val root: DocTag) : TagWrapper()
+data class Since(override val root: DocTag) : TagWrapper()
+data class See(override val root: DocTag, override val name: String, val address: DRI?) : NamedTagWrapper()
+data class Param(override val root: DocTag, override val name: String) : NamedTagWrapper()
+data class Return(override val root: DocTag) : TagWrapper()
+data class Receiver(override val root: DocTag) : TagWrapper()
+data class Constructor(override val root: DocTag) : TagWrapper()
+data class Throws(override val root: DocTag, override val name: String) : NamedTagWrapper()
+data class Sample(override val root: DocTag, override val name: String) : NamedTagWrapper()
+data class Deprecated(override val root: DocTag) : TagWrapper()
+data class Property(override val root: DocTag, override val name: String) : NamedTagWrapper()
+data class Suppress(override val root: DocTag) : TagWrapper()
+data class CustomTagWrapper(override val root: DocTag, override val name: String) : NamedTagWrapper()