From 84ea5c68420a75c7b8401000dbe6dbf3ff2cd6d0 Mon Sep 17 00:00:00 2001 From: Dmitry Jemerov Date: Wed, 4 Nov 2015 16:26:07 +0100 Subject: @Inject all the things --- src/Java/JavaPsiDocumentationBuilder.kt | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/Java/JavaPsiDocumentationBuilder.kt') diff --git a/src/Java/JavaPsiDocumentationBuilder.kt b/src/Java/JavaPsiDocumentationBuilder.kt index b1e3167d..44270bc7 100644 --- a/src/Java/JavaPsiDocumentationBuilder.kt +++ b/src/Java/JavaPsiDocumentationBuilder.kt @@ -1,5 +1,6 @@ package org.jetbrains.dokka +import com.google.inject.Inject import com.intellij.psi.* import org.jetbrains.dokka.DocumentationNode.Kind @@ -29,9 +30,23 @@ interface JavaDocumentationBuilder { fun appendFile(file: PsiJavaFile, module: DocumentationModule, packageContent: Map) } -class JavaPsiDocumentationBuilder(private val options: DocumentationOptions, - private val refGraph: NodeReferenceGraph, - private val docParser: JavaDocumentationParser = JavadocParser(refGraph)) : JavaDocumentationBuilder { +class JavaPsiDocumentationBuilder : JavaDocumentationBuilder { + private val options: DocumentationOptions + private val refGraph: NodeReferenceGraph + private val docParser: JavaDocumentationParser + + @Inject constructor(options: DocumentationOptions, refGraph: NodeReferenceGraph) { + this.options = options + this.refGraph = refGraph + this.docParser = JavadocParser(refGraph) + } + + constructor(options: DocumentationOptions, refGraph: NodeReferenceGraph, docParser: JavaDocumentationParser) { + this.options = options + this.refGraph = refGraph + this.docParser = docParser + } + override fun appendFile(file: PsiJavaFile, module: DocumentationModule, packageContent: Map) { if (file.classes.all { skipElement(it) }) { return -- cgit