diff options
-rw-r--r-- | core/src/main/kotlin/model/doc/TagWrapper.kt | 35 | ||||
-rw-r--r-- | core/src/main/kotlin/parsers/Parser.kt | 2 |
2 files changed, 11 insertions, 26 deletions
diff --git a/core/src/main/kotlin/model/doc/TagWrapper.kt b/core/src/main/kotlin/model/doc/TagWrapper.kt index fa9031d7..9dda7c8f 100644 --- a/core/src/main/kotlin/model/doc/TagWrapper.kt +++ b/core/src/main/kotlin/model/doc/TagWrapper.kt @@ -11,36 +11,23 @@ sealed class TagWrapper(val root: DocTag) { 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() +} + 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, val name: String) : TagWrapper(root) { - override fun equals(other: Any?): Boolean = super.equals(other) && this.name == (other as See).name - override fun hashCode(): Int = super.hashCode() + name.hashCode() -} -class Param(root: DocTag, val name: String) : TagWrapper(root) { - override fun equals(other: Any?): Boolean = super.equals(other) && this.name == (other as Param).name - override fun hashCode(): Int = super.hashCode() + name.hashCode() -} +class See(root: DocTag, name: String) : 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, val name: String) : TagWrapper(root) { - override fun equals(other: Any?): Boolean = super.equals(other) && this.name == (other as Throws).name - override fun hashCode(): Int = super.hashCode() + name.hashCode() -} -class Sample(root: DocTag, val name: String) : TagWrapper(root) { - override fun equals(other: Any?): Boolean = super.equals(other) && this.name == (other as Sample).name - override fun hashCode(): Int = super.hashCode() + name.hashCode() -} +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, val name: String) : TagWrapper(root) { - override fun equals(other: Any?): Boolean = super.equals(other) && this.name == (other as Property).name - override fun hashCode(): Int = super.hashCode() + name.hashCode() -} +class Property(root: DocTag, name: String) : NamedTagWrapper(root, name) class Suppress(root: DocTag) : TagWrapper(root) -class CustomWrapperTag(root: DocTag, val name: String) : TagWrapper(root) { - override fun equals(other: Any?): Boolean = super.equals(other) && this.name == (other as CustomWrapperTag).name - override fun hashCode(): Int = super.hashCode() + name.hashCode() -}
\ No newline at end of file +class CustomWrapperTag(root: DocTag, name: String) : NamedTagWrapper(root, name)
\ No newline at end of file diff --git a/core/src/main/kotlin/parsers/Parser.kt b/core/src/main/kotlin/parsers/Parser.kt index daa9f38d..f03e57be 100644 --- a/core/src/main/kotlin/parsers/Parser.kt +++ b/core/src/main/kotlin/parsers/Parser.kt @@ -1,8 +1,6 @@ package org.jetbrains.dokka.parsers import org.jetbrains.dokka.model.doc.* -import org.jetbrains.dokka.model.doc.Deprecated - abstract class Parser { |