From e27fb69817b1417c1bc556a507b14f2700c7a736 Mon Sep 17 00:00:00 2001 From: Sergey Mashkov Date: Fri, 31 Jul 2015 15:35:34 +0300 Subject: Use Guice injector and ServiceLocator to load implementations on the fly --- javadoc/src/main/kotlin/dokka-adapters.kt | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 javadoc/src/main/kotlin/dokka-adapters.kt (limited to 'javadoc/src/main/kotlin/dokka-adapters.kt') diff --git a/javadoc/src/main/kotlin/dokka-adapters.kt b/javadoc/src/main/kotlin/dokka-adapters.kt new file mode 100644 index 00000000..c9183d50 --- /dev/null +++ b/javadoc/src/main/kotlin/dokka-adapters.kt @@ -0,0 +1,29 @@ +package org.jetbrains.dokka.javadoc + +import com.sun.tools.doclets.formats.html.HtmlDoclet +import org.jetbrains.dokka.* +import org.jetbrains.dokka.Formats.FormatDescriptor + +class JavadocGenerator(val conf: DokkaGenerator) : Generator { + override fun buildPages(nodes: Iterable) { + val module = nodes.single() as DocumentationModule + + DokkaConsoleLogger.report() + HtmlDoclet.start(ModuleNodeAdapter(module, StandardReporter, conf.outputDir)) + } + + override fun buildOutlines(nodes: Iterable) { + // no outline could be generated separately + } +} + +class JavadocFormatDescriptor : FormatDescriptor { + override val formatServiceClass: Class? + get() = null + override val outlineServiceClass: Class? + get() = null + + override val generatorServiceClass: Class + get() = javaClass() +} + -- cgit