aboutsummaryrefslogtreecommitdiff
path: root/src/Java/JavaDocumentationBuilder.kt
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-16 14:11:57 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-16 14:11:57 +0100
commit3e3a4af652358214815ea28e094d6f4d2554bde8 (patch)
tree4695c9f077c018a161679c50ed8752246060da18 /src/Java/JavaDocumentationBuilder.kt
parent6d5d88b88039799f19ecc4be74deb6a775bb462d (diff)
downloaddokka-3e3a4af652358214815ea28e094d6f4d2554bde8.tar.gz
dokka-3e3a4af652358214815ea28e094d6f4d2554bde8.tar.bz2
dokka-3e3a4af652358214815ea28e094d6f4d2554bde8.zip
represent static methods as class object functions
Diffstat (limited to 'src/Java/JavaDocumentationBuilder.kt')
-rw-r--r--src/Java/JavaDocumentationBuilder.kt11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/Java/JavaDocumentationBuilder.kt b/src/Java/JavaDocumentationBuilder.kt
index d57ffb0c..8408d25a 100644
--- a/src/Java/JavaDocumentationBuilder.kt
+++ b/src/Java/JavaDocumentationBuilder.kt
@@ -110,8 +110,7 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions)
}
fun PsiMethod.build(): DocumentationNode {
- val node = DocumentationNode(this,
- if (isConstructor()) Kind.Constructor else Kind.Function,
+ val node = DocumentationNode(this, nodeKind(),
if (isConstructor()) "<init>" else getName())
if (!isConstructor()) {
@@ -122,6 +121,12 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions)
return node
}
+ private fun PsiMethod.nodeKind(): Kind = when {
+ isConstructor() -> Kind.Constructor
+ hasModifierProperty(PsiModifier.STATIC) -> Kind.ClassObjectFunction
+ else -> Kind.Function
+ }
+
fun PsiParameter.build(): DocumentationNode {
val node = DocumentationNode(this, Kind.Parameter)
node.appendType(getType())
@@ -144,7 +149,7 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions)
return
}
PsiModifier.MODIFIERS.forEach {
- if (modifierList.hasExplicitModifier(it)) {
+ if (it != "static" && modifierList.hasExplicitModifier(it)) {
val modifierNode = DocumentationNode(it, Content.Empty, Kind.Modifier)
append(modifierNode, DocumentationReference.Kind.Detail)
}