diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Java/JavaDocumentationBuilder.kt | 7 |
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) { |