diff options
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/kotlin/model/doc/DocTag.kt | 3 | ||||
-rw-r--r-- | core/src/main/kotlin/model/doc/TagWrapper.kt | 48 |
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() |