diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-10-29 13:31:16 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-10-29 13:31:16 +0100 |
commit | 4e09ac20457e2c4398406a1c23bf1f435f31349e (patch) | |
tree | 87e074f00e3d31ac3c73a2b1d64ad7fc20375f8d /src/Languages/JavaLanguageService.kt | |
parent | c9d59e9ae85f76e021d53c77ef18bfce0ff7ec7c (diff) | |
parent | 8216501e9a07940ed0a0be3d204733df9a9d811c (diff) | |
download | dokka-4e09ac20457e2c4398406a1c23bf1f435f31349e.tar.gz dokka-4e09ac20457e2c4398406a1c23bf1f435f31349e.tar.bz2 dokka-4e09ac20457e2c4398406a1c23bf1f435f31349e.zip |
Merge branch 'javadoc' of https://github.com/cy6erGn0m/dokka into cy6erGn0m-javadoc
# Conflicts:
# dokka.iml
# javadoc/javadoc.iml
# javadoc/src/main/kotlin/docbase.kt
# javadoc/src/main/kotlin/dokka-adapters.kt
# javadoc/src/main/kotlin/reporter.kt
# javadoc/src/main/kotlin/tags.kt
# src/Analysis/AnalysisEnvironment.kt
# src/Analysis/CompilerAPI.kt
# src/Formats/KotlinWebsiteFormatService.kt
# src/Formats/StructuredFormatService.kt
# src/Java/JavaDocumentationBuilder.kt
# src/Kotlin/ContentBuilder.kt
# src/Kotlin/DocumentationBuilder.kt
# src/Languages/JavaLanguageService.kt
# src/Model/Content.kt
# src/Model/PackageDocs.kt
# src/Utilities/GuiceModule.kt
# src/Utilities/Path.kt
# src/Utilities/ServiceLocator.kt
# test/src/markdown/MarkdownTestRunner.kt
Diffstat (limited to 'src/Languages/JavaLanguageService.kt')
-rw-r--r-- | src/Languages/JavaLanguageService.kt | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/Languages/JavaLanguageService.kt b/src/Languages/JavaLanguageService.kt index 8648448e..5750588e 100644 --- a/src/Languages/JavaLanguageService.kt +++ b/src/Languages/JavaLanguageService.kt @@ -48,6 +48,18 @@ public class JavaLanguageService : LanguageService { } } + public fun getArrayElementType(node: DocumentationNode): DocumentationNode? = when (node.name) { + "Array" -> node.details(Kind.Type).singleOrNull()?.let { et -> getArrayElementType(et) ?: et } ?: DocumentationNode("Object", node.content, DocumentationNode.Kind.ExternalClass) + "IntArray", "LongArray", "ShortArray", "ByteArray", "CharArray", "DoubleArray", "FloatArray", "BooleanArray" -> DocumentationNode(node.name.removeSuffix("Array").toLowerCase(), node.content, DocumentationNode.Kind.Type) + else -> null + } + + public fun getArrayDimension(node: DocumentationNode): Int = when (node.name) { + "Array" -> 1 + (node.details(DocumentationNode.Kind.Type).singleOrNull()?.let { getArrayDimension(it) } ?: 0) + "IntArray", "LongArray", "ShortArray", "ByteArray", "CharArray", "DoubleArray", "FloatArray", "BooleanArray" -> 1 + else -> 0 + } + public fun renderType(node: DocumentationNode): String { return when (node.name) { "Unit" -> "void" |