diff options
author | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-16 16:22:38 +0100 |
---|---|---|
committer | Dmitry Jemerov <yole@jetbrains.com> | 2015-02-16 16:22:38 +0100 |
commit | 4bec8fc549a8c6614ad5871417b9cbcfb1dee57b (patch) | |
tree | 5901483d257481c6326d01c88af7451b8152841f /src/Java | |
parent | 17e25efa87dc6eea3b1e098619a07a65f0b3f8e8 (diff) | |
download | dokka-4bec8fc549a8c6614ad5871417b9cbcfb1dee57b.tar.gz dokka-4bec8fc549a8c6614ad5871417b9cbcfb1dee57b.tar.bz2 dokka-4bec8fc549a8c6614ad5871417b9cbcfb1dee57b.zip |
represent java.lang.Deprecated annotation as deprecation
Diffstat (limited to 'src/Java')
-rw-r--r-- | src/Java/JavaDocumentationBuilder.kt | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Java/JavaDocumentationBuilder.kt b/src/Java/JavaDocumentationBuilder.kt index f3cc38f7..18fce4db 100644 --- a/src/Java/JavaDocumentationBuilder.kt +++ b/src/Java/JavaDocumentationBuilder.kt @@ -20,6 +20,7 @@ import com.intellij.psi.javadoc.PsiDocTagValue import com.intellij.psi.PsiEllipsisType import com.intellij.psi.PsiField import com.intellij.psi.PsiAnnotation +import com.intellij.psi.PsiLiteralExpression public class JavaDocumentationBuilder(private val options: DocumentationOptions) { fun appendFile(file: PsiJavaFile, module: DocumentationModule) { @@ -62,7 +63,11 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions) node.appendModifiers(element) val modifierList = element.getModifierList() if (modifierList != null) { - node.appendChildren(modifierList.getAnnotations(), DocumentationReference.Kind.Annotation) { build() } + modifierList.getAnnotations().forEach { + val annotation = it.build() + node.append(annotation, + if (it.getQualifiedName() == "java.lang.Deprecated") DocumentationReference.Kind.Deprecation else DocumentationReference.Kind.Annotation) + } } } return node @@ -201,7 +206,8 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions) val parameter = DocumentationNode(it.getName() ?: "value", Content.Empty, DocumentationNode.Kind.Parameter) val value = it.getValue() if (value != null) { - val valueNode = DocumentationNode(value.getText(), Content.Empty, DocumentationNode.Kind.Value) + val valueText = (value as? PsiLiteralExpression)?.getValue() as? String ?: value.getText() + val valueNode = DocumentationNode(valueText, Content.Empty, DocumentationNode.Kind.Value) parameter.append(valueNode, DocumentationReference.Kind.Detail) } node.append(parameter, DocumentationReference.Kind.Detail) |