aboutsummaryrefslogtreecommitdiff
path: root/core/src/main/kotlin/Model
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2016-01-04 19:39:39 +0100
committerDmitry Jemerov <yole@jetbrains.com>2016-01-04 19:39:39 +0100
commit3b3c2841674d9b7044494d16d4396662d273f1f9 (patch)
tree268f6d3085b05da702d5d61eff505000cd9ea36a /core/src/main/kotlin/Model
parent0260b37dd051fc5d728820fa20b0ad7d94c33c0f (diff)
downloaddokka-3b3c2841674d9b7044494d16d4396662d273f1f9.tar.gz
dokka-3b3c2841674d9b7044494d16d4396662d273f1f9.tar.bz2
dokka-3b3c2841674d9b7044494d16d4396662d273f1f9.zip
cleanup: remove redundant 'public' modifiers
Diffstat (limited to 'core/src/main/kotlin/Model')
-rw-r--r--core/src/main/kotlin/Model/Content.kt70
-rw-r--r--core/src/main/kotlin/Model/DocumentationNode.kt60
-rw-r--r--core/src/main/kotlin/Model/DocumentationReference.kt4
-rw-r--r--core/src/main/kotlin/Model/PackageDocs.kt6
4 files changed, 70 insertions, 70 deletions
diff --git a/core/src/main/kotlin/Model/Content.kt b/core/src/main/kotlin/Model/Content.kt
index 6556b09e..1bf1da48 100644
--- a/core/src/main/kotlin/Model/Content.kt
+++ b/core/src/main/kotlin/Model/Content.kt
@@ -1,14 +1,14 @@
package org.jetbrains.dokka
-public interface ContentNode {
+interface ContentNode {
val textLength: Int
}
-public object ContentEmpty : ContentNode {
+object ContentEmpty : ContentNode {
override val textLength: Int get() = 0
}
-public open class ContentBlock() : ContentNode {
+open class ContentBlock() : ContentNode {
val children = arrayListOf<ContentNode>()
fun append(node: ContentNode) {
@@ -35,58 +35,58 @@ enum class IdentifierKind {
Other
}
-public data class ContentText(val text: String) : ContentNode {
+data class ContentText(val text: String) : ContentNode {
override val textLength: Int
get() = text.length
}
-public data class ContentKeyword(val text: String) : ContentNode {
+data class ContentKeyword(val text: String) : ContentNode {
override val textLength: Int
get() = text.length
}
-public data class ContentIdentifier(val text: String, val kind: IdentifierKind = IdentifierKind.Other) : ContentNode {
+data class ContentIdentifier(val text: String, val kind: IdentifierKind = IdentifierKind.Other) : ContentNode {
override val textLength: Int
get() = text.length
}
-public data class ContentSymbol(val text: String) : ContentNode {
+data class ContentSymbol(val text: String) : ContentNode {
override val textLength: Int
get() = text.length
}
-public data class ContentEntity(val text: String) : ContentNode {
+data class ContentEntity(val text: String) : ContentNode {
override val textLength: Int
get() = text.length
}
-public object ContentNonBreakingSpace: ContentNode {
+object ContentNonBreakingSpace: ContentNode {
override val textLength: Int
get() = 1
}
-public object ContentSoftLineBreak: ContentNode {
+object ContentSoftLineBreak: ContentNode {
override val textLength: Int
get() = 0
}
-public object ContentIndentedSoftLineBreak: ContentNode {
+object ContentIndentedSoftLineBreak: ContentNode {
override val textLength: Int
get() = 0
}
-public class ContentParagraph() : ContentBlock()
-public class ContentEmphasis() : ContentBlock()
-public class ContentStrong() : ContentBlock()
-public class ContentStrikethrough() : ContentBlock()
-public class ContentCode() : ContentBlock()
-public class ContentBlockCode(val language: String = "") : ContentBlock()
+class ContentParagraph() : ContentBlock()
+class ContentEmphasis() : ContentBlock()
+class ContentStrong() : ContentBlock()
+class ContentStrikethrough() : ContentBlock()
+class ContentCode() : ContentBlock()
+class ContentBlockCode(val language: String = "") : ContentBlock()
-public abstract class ContentNodeLink() : ContentBlock() {
+abstract class ContentNodeLink() : ContentBlock() {
abstract val node: DocumentationNode?
}
-public class ContentNodeDirectLink(override val node: DocumentationNode): ContentNodeLink() {
+class ContentNodeDirectLink(override val node: DocumentationNode): ContentNodeLink() {
override fun equals(other: Any?): Boolean =
super.equals(other) && other is ContentNodeDirectLink && node.name == other.node.name
@@ -94,7 +94,7 @@ public class ContentNodeDirectLink(override val node: DocumentationNode): Conten
children.hashCode() * 31 + node.name.hashCode()
}
-public class ContentNodeLazyLink(val linkText: String, val lazyNode: () -> DocumentationNode?): ContentNodeLink() {
+class ContentNodeLazyLink(val linkText: String, val lazyNode: () -> DocumentationNode?): ContentNodeLink() {
override val node: DocumentationNode? get() = lazyNode()
override fun equals(other: Any?): Boolean =
@@ -104,7 +104,7 @@ public class ContentNodeLazyLink(val linkText: String, val lazyNode: () -> Docum
children.hashCode() * 31 + linkText.hashCode()
}
-public class ContentExternalLink(val href : String) : ContentBlock() {
+class ContentExternalLink(val href : String) : ContentBlock() {
override fun equals(other: Any?): Boolean =
super.equals(other) && other is ContentExternalLink && href == other.href
@@ -112,13 +112,13 @@ public class ContentExternalLink(val href : String) : ContentBlock() {
children.hashCode() * 31 + href.hashCode()
}
-public class ContentUnorderedList() : ContentBlock()
-public class ContentOrderedList() : ContentBlock()
-public class ContentListItem() : ContentBlock()
+class ContentUnorderedList() : ContentBlock()
+class ContentOrderedList() : ContentBlock()
+class ContentListItem() : ContentBlock()
-public class ContentHeading(val level: Int) : ContentBlock()
+class ContentHeading(val level: Int) : ContentBlock()
-public class ContentSection(public val tag: String, public val subjectName: String?) : ContentBlock() {
+class ContentSection(val tag: String, val subjectName: String?) : ContentBlock() {
override fun equals(other: Any?): Boolean =
super.equals(other) && other is ContentSection && tag == other.tag && subjectName == other.subjectName
@@ -126,7 +126,7 @@ public class ContentSection(public val tag: String, public val subjectName: Stri
children.hashCode() * 31 * 31 + tag.hashCode() * 31 + (subjectName?.hashCode() ?: 0)
}
-public object ContentTags {
+object ContentTags {
val Description = "Description"
val SeeAlso = "See Also"
}
@@ -163,10 +163,10 @@ fun ContentBlock.link(to: DocumentationNode, body: ContentBlock.() -> Unit) {
append(block)
}
-public open class Content(): ContentBlock() {
- public open val sections: List<ContentSection> get() = emptyList()
- public open val summary: ContentNode get() = ContentEmpty
- public open val description: ContentNode get() = ContentEmpty
+open class Content(): ContentBlock() {
+ open val sections: List<ContentSection> get() = emptyList()
+ open val summary: ContentNode get() = ContentEmpty
+ open val description: ContentNode get() = ContentEmpty
fun findSectionByTag(tag: String): ContentSection? =
sections.firstOrNull { tag.equals(it.tag, ignoreCase = true) }
@@ -182,9 +182,9 @@ public open class Content(): ContentBlock() {
}
}
-public open class MutableContent() : Content() {
+open class MutableContent() : Content() {
private val sectionList = arrayListOf<ContentSection>()
- public override val sections: List<ContentSection>
+ override val sections: List<ContentSection>
get() = sectionList
fun addSection(tag: String?, subjectName: String?): ContentSection {
@@ -193,9 +193,9 @@ public open class MutableContent() : Content() {
return section
}
- public override val summary: ContentNode get() = children.firstOrNull() ?: ContentEmpty
+ override val summary: ContentNode get() = children.firstOrNull() ?: ContentEmpty
- public override val description: ContentNode by lazy {
+ override val description: ContentNode by lazy {
val descriptionNodes = children.drop(1)
if (descriptionNodes.isEmpty()) {
ContentEmpty
diff --git a/core/src/main/kotlin/Model/DocumentationNode.kt b/core/src/main/kotlin/Model/DocumentationNode.kt
index 52881f65..35933aee 100644
--- a/core/src/main/kotlin/Model/DocumentationNode.kt
+++ b/core/src/main/kotlin/Model/DocumentationNode.kt
@@ -2,73 +2,73 @@ package org.jetbrains.dokka
import java.util.*
-public open class DocumentationNode(val name: String,
- content: Content,
- val kind: DocumentationNode.Kind) {
+open class DocumentationNode(val name: String,
+ content: Content,
+ val kind: DocumentationNode.Kind) {
private val references = LinkedHashSet<DocumentationReference>()
var content: Content = content
private set
- public val summary: ContentNode get() = content.summary
+ val summary: ContentNode get() = content.summary
- public val owner: DocumentationNode?
+ val owner: DocumentationNode?
get() = references(DocumentationReference.Kind.Owner).singleOrNull()?.to
- public val details: List<DocumentationNode>
+ val details: List<DocumentationNode>
get() = references(DocumentationReference.Kind.Detail).map { it.to }
- public val members: List<DocumentationNode>
+ val members: List<DocumentationNode>
get() = references(DocumentationReference.Kind.Member).map { it.to }
- public val inheritedMembers: List<DocumentationNode>
+ val inheritedMembers: List<DocumentationNode>
get() = references(DocumentationReference.Kind.InheritedMember).map { it.to }
- public val extensions: List<DocumentationNode>
+ val extensions: List<DocumentationNode>
get() = references(DocumentationReference.Kind.Extension).map { it.to }
- public val inheritors: List<DocumentationNode>
+ val inheritors: List<DocumentationNode>
get() = references(DocumentationReference.Kind.Inheritor).map { it.to }
- public val overrides: List<DocumentationNode>
+ val overrides: List<DocumentationNode>
get() = references(DocumentationReference.Kind.Override).map { it.to }
- public val links: List<DocumentationNode>
+ val links: List<DocumentationNode>
get() = references(DocumentationReference.Kind.Link).map { it.to }
- public val hiddenLinks: List<DocumentationNode>
+ val hiddenLinks: List<DocumentationNode>
get() = references(DocumentationReference.Kind.HiddenLink).map { it.to }
- public val annotations: List<DocumentationNode>
+ val annotations: List<DocumentationNode>
get() = references(DocumentationReference.Kind.Annotation).map { it.to }
- public val deprecation: DocumentationNode?
+ val deprecation: DocumentationNode?
get() = references(DocumentationReference.Kind.Deprecation).singleOrNull()?.to
// TODO: Should we allow node mutation? Model merge will copy by ref, so references are transparent, which could nice
- public fun addReferenceTo(to: DocumentationNode, kind: DocumentationReference.Kind) {
+ fun addReferenceTo(to: DocumentationNode, kind: DocumentationReference.Kind) {
references.add(DocumentationReference(this, to, kind))
}
- public fun addAllReferencesFrom(other: DocumentationNode) {
+ fun addAllReferencesFrom(other: DocumentationNode) {
references.addAll(other.references)
}
- public fun updateContent(body: MutableContent.() -> Unit) {
+ fun updateContent(body: MutableContent.() -> Unit) {
if (content !is MutableContent) {
content = MutableContent()
}
(content as MutableContent).body()
}
- public fun details(kind: DocumentationNode.Kind): List<DocumentationNode> = details.filter { it.kind == kind }
- public fun members(kind: DocumentationNode.Kind): List<DocumentationNode> = members.filter { it.kind == kind }
- public fun inheritedMembers(kind: DocumentationNode.Kind): List<DocumentationNode> = inheritedMembers.filter { it.kind == kind }
- public fun links(kind: DocumentationNode.Kind): List<DocumentationNode> = links.filter { it.kind == kind }
+ fun details(kind: DocumentationNode.Kind): List<DocumentationNode> = details.filter { it.kind == kind }
+ fun members(kind: DocumentationNode.Kind): List<DocumentationNode> = members.filter { it.kind == kind }
+ fun inheritedMembers(kind: DocumentationNode.Kind): List<DocumentationNode> = inheritedMembers.filter { it.kind == kind }
+ fun links(kind: DocumentationNode.Kind): List<DocumentationNode> = links.filter { it.kind == kind }
- public fun detail(kind: DocumentationNode.Kind): DocumentationNode = details.filter { it.kind == kind }.single()
- public fun member(kind: DocumentationNode.Kind): DocumentationNode = members.filter { it.kind == kind }.single()
- public fun link(kind: DocumentationNode.Kind): DocumentationNode = links.filter { it.kind == kind }.single()
+ fun detail(kind: DocumentationNode.Kind): DocumentationNode = details.filter { it.kind == kind }.single()
+ fun member(kind: DocumentationNode.Kind): DocumentationNode = members.filter { it.kind == kind }.single()
+ fun link(kind: DocumentationNode.Kind): DocumentationNode = links.filter { it.kind == kind }.single()
- public fun references(kind: DocumentationReference.Kind): List<DocumentationReference> = references.filter { it.kind == kind }
- public fun allReferences(): Set<DocumentationReference> = references
+ fun references(kind: DocumentationReference.Kind): List<DocumentationReference> = references.filter { it.kind == kind }
+ fun allReferences(): Set<DocumentationReference> = references
- public override fun toString(): String {
+ override fun toString(): String {
return "$kind:$name"
}
- public enum class Kind {
+ enum class Kind {
Unknown,
Package,
@@ -121,7 +121,7 @@ public open class DocumentationNode(val name: String,
}
}
-public class DocumentationModule(name: String, content: Content = Content.Empty)
+class DocumentationModule(name: String, content: Content = Content.Empty)
: DocumentationNode(name, content, DocumentationNode.Kind.Module) {
}
diff --git a/core/src/main/kotlin/Model/DocumentationReference.kt b/core/src/main/kotlin/Model/DocumentationReference.kt
index 898c92d7..99a1f434 100644
--- a/core/src/main/kotlin/Model/DocumentationReference.kt
+++ b/core/src/main/kotlin/Model/DocumentationReference.kt
@@ -2,8 +2,8 @@ package org.jetbrains.dokka
import com.google.inject.Singleton
-public data class DocumentationReference(val from: DocumentationNode, val to: DocumentationNode, val kind: DocumentationReference.Kind) {
- public enum class Kind {
+data class DocumentationReference(val from: DocumentationNode, val to: DocumentationNode, val kind: DocumentationReference.Kind) {
+ enum class Kind {
Owner,
Member,
InheritedMember,
diff --git a/core/src/main/kotlin/Model/PackageDocs.kt b/core/src/main/kotlin/Model/PackageDocs.kt
index 044c73d8..5ebf2119 100644
--- a/core/src/main/kotlin/Model/PackageDocs.kt
+++ b/core/src/main/kotlin/Model/PackageDocs.kt
@@ -8,13 +8,13 @@ import org.jetbrains.kotlin.resolve.lazy.descriptors.LazyPackageDescriptor
import java.io.File
@Singleton
-public class PackageDocs
+class PackageDocs
@Inject constructor(val linkResolver: DeclarationLinkResolver?,
val logger: DokkaLogger)
{
- public val moduleContent: MutableContent = MutableContent()
+ val moduleContent: MutableContent = MutableContent()
private val _packageContent: MutableMap<String, MutableContent> = hashMapOf()
- public val packageContent: Map<String, Content>
+ val packageContent: Map<String, Content>
get() = _packageContent
fun parse(fileName: String, linkResolveContext: LazyPackageDescriptor?) {