aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-02-16 16:57:16 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-02-16 16:57:16 +0100
commit4c6cbfad61358285f51c51e86f070af5546895e6 (patch)
tree482f4440f9984ca1144cc4c154e2c843d164128e
parent76e0db0359d8bdcdbbc7efddeccf115c2e5c731d (diff)
downloaddokka-4c6cbfad61358285f51c51e86f070af5546895e6.tar.gz
dokka-4c6cbfad61358285f51c51e86f070af5546895e6.tar.bz2
dokka-4c6cbfad61358285f51c51e86f070af5546895e6.zip
ignore SuppressWarnings annotations
-rw-r--r--src/Java/JavaDocumentationBuilder.kt7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Java/JavaDocumentationBuilder.kt b/src/Java/JavaDocumentationBuilder.kt
index f6e01a75..d501d98a 100644
--- a/src/Java/JavaDocumentationBuilder.kt
+++ b/src/Java/JavaDocumentationBuilder.kt
@@ -64,7 +64,7 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions)
node.appendModifiers(element)
val modifierList = element.getModifierList()
if (modifierList != null) {
- modifierList.getAnnotations().forEach {
+ modifierList.getAnnotations().filter { !ignoreAnnotation(it) }.forEach {
val annotation = it.build()
node.append(annotation,
if (it.getQualifiedName() == "java.lang.Deprecated") DocumentationReference.Kind.Deprecation else DocumentationReference.Kind.Annotation)
@@ -74,6 +74,11 @@ public class JavaDocumentationBuilder(private val options: DocumentationOptions)
return node
}
+ fun ignoreAnnotation(annotation: PsiAnnotation) = when(annotation.getQualifiedName()) {
+ "java.lang.SuppressWarnings" -> true
+ else -> false
+ }
+
fun DocumentationNode.appendChildren<T>(elements: Array<T>,
kind: DocumentationReference.Kind = DocumentationReference.Kind.Member,
buildFn: T.() -> DocumentationNode) {