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/Formats/StandardFormats.kt | 69 +++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 45 deletions(-) (limited to 'src/Formats/StandardFormats.kt') diff --git a/src/Formats/StandardFormats.kt b/src/Formats/StandardFormats.kt index 12b5d85d..94e1b115 100644 --- a/src/Formats/StandardFormats.kt +++ b/src/Formats/StandardFormats.kt @@ -2,58 +2,37 @@ package org.jetbrains.dokka.Formats import org.jetbrains.dokka.* -class HtmlFormatDescriptor : FormatDescriptor { - override val formatServiceClass: Class - get() = HtmlFormatService::class.java +abstract class KotlinFormatDescriptorBase : FormatDescriptor { + override val packageDocumentationBuilderClass = KotlinPackageDocumentationBuilder::class + override val javaDocumentationBuilderClass = KotlinJavaDocumentationBuilder::class - override val outlineServiceClass: Class - get() = HtmlFormatService::class.java - - override val generatorServiceClass: Class - get() = FileGenerator::class.java - - override val packageDocumentationBuilderServiceClass: Class? - get() = null + override val generatorServiceClass = FileGenerator::class } -class KotlinWebsiteFormatDescriptor : FormatDescriptor { - override val formatServiceClass: Class - get() = KotlinWebsiteFormatService::class.java - - override val outlineServiceClass: Class - get() = YamlOutlineService::class.java - - override val generatorServiceClass: Class - get() = FileGenerator::class.java - - override val packageDocumentationBuilderServiceClass: Class? - get() = null +class HtmlFormatDescriptor : KotlinFormatDescriptorBase() { + override val formatServiceClass = HtmlFormatService::class + override val outlineServiceClass = HtmlFormatService::class } -class JekyllFormatDescriptor : FormatDescriptor { - override val formatServiceClass: Class - get() = JekyllFormatService::class.java - - override val outlineServiceClass: Class? - get() = null - - override val generatorServiceClass: Class - get() = FileGenerator::class.java - - override val packageDocumentationBuilderServiceClass: Class? - get() = null +class HtmlAsJavaFormatDescriptor : FormatDescriptor { + override val formatServiceClass = HtmlFormatService::class + override val outlineServiceClass = HtmlFormatService::class + override val generatorServiceClass = FileGenerator::class + override val packageDocumentationBuilderClass = KotlinAsJavaDocumentationBuilder::class + override val javaDocumentationBuilderClass = JavaPsiDocumentationBuilder::class } -class MarkdownFormatDescriptor : FormatDescriptor { - override val formatServiceClass: Class - get() = MarkdownFormatService::class.java - - override val outlineServiceClass: Class? - get() = null +class KotlinWebsiteFormatDescriptor : KotlinFormatDescriptorBase() { + override val formatServiceClass = KotlinWebsiteFormatService::class + override val outlineServiceClass = YamlOutlineService::class +} - override val generatorServiceClass: Class - get() = FileGenerator::class.java +class JekyllFormatDescriptor : KotlinFormatDescriptorBase() { + override val formatServiceClass = JekyllFormatService::class + override val outlineServiceClass = null +} - override val packageDocumentationBuilderServiceClass: Class? - get() = null +class MarkdownFormatDescriptor : KotlinFormatDescriptorBase() { + override val formatServiceClass = MarkdownFormatService::class + override val outlineServiceClass = null } -- cgit