From 4c6cbfad61358285f51c51e86f070af5546895e6 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Mon, 16 Feb 2015 16:57:16 +0100 Subject: ignore SuppressWarnings annotations --- src/Java/JavaDocumentationBuilder.kt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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(elements: Array, kind: DocumentationReference.Kind = DocumentationReference.Kind.Member, buildFn: T.() -> DocumentationNode) { -- cgit