aboutsummaryrefslogtreecommitdiff
path: root/javadoc/src/main/kotlin/dokka-adapters.kt
blob: c9183d506522d3b2f29562a94612140dba2bcc48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
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<DocumentationNode>) {
        val module = nodes.single() as DocumentationModule

        DokkaConsoleLogger.report()
        HtmlDoclet.start(ModuleNodeAdapter(module, StandardReporter, conf.outputDir))
    }

    override fun buildOutlines(nodes: Iterable<DocumentationNode>) {
        // no outline could be generated separately
    }
}

class JavadocFormatDescriptor : FormatDescriptor {
    override val formatServiceClass: Class<out FormatService>?
        get() = null
    override val outlineServiceClass: Class<out OutlineFormatService>?
        get() = null

    override val generatorServiceClass: Class<out Generator>
        get() = javaClass<JavadocGenerator>()
}