aboutsummaryrefslogtreecommitdiff
path: root/src/Formats
diff options
context:
space:
mode:
authorDmitry Jemerov <yole@jetbrains.com>2015-11-04 16:26:07 +0100
committerDmitry Jemerov <yole@jetbrains.com>2015-11-04 16:26:07 +0100
commit84ea5c68420a75c7b8401000dbe6dbf3ff2cd6d0 (patch)
treee2f655042a05a5ce0b5ed3b111824afdcbc28ded /src/Formats
parent3655b706ea22ab9d7ee02a8d5074aa583e848018 (diff)
downloaddokka-84ea5c68420a75c7b8401000dbe6dbf3ff2cd6d0.tar.gz
dokka-84ea5c68420a75c7b8401000dbe6dbf3ff2cd6d0.tar.bz2
dokka-84ea5c68420a75c7b8401000dbe6dbf3ff2cd6d0.zip
@Inject all the things
Diffstat (limited to 'src/Formats')
-rw-r--r--src/Formats/FormatDescriptor.kt15
-rw-r--r--src/Formats/StandardFormats.kt69
2 files changed, 31 insertions, 53 deletions
diff --git a/src/Formats/FormatDescriptor.kt b/src/Formats/FormatDescriptor.kt
index cc12dfb9..0c7ca794 100644
--- a/src/Formats/FormatDescriptor.kt
+++ b/src/Formats/FormatDescriptor.kt
@@ -1,13 +1,12 @@
package org.jetbrains.dokka.Formats
-import org.jetbrains.dokka.FormatService
-import org.jetbrains.dokka.Generator
-import org.jetbrains.dokka.OutlineFormatService
-import org.jetbrains.dokka.PackageDocumentationBuilder
+import org.jetbrains.dokka.*
+import kotlin.reflect.KClass
public interface FormatDescriptor {
- val formatServiceClass: Class<out FormatService>?
- val outlineServiceClass: Class<out OutlineFormatService>?
- val generatorServiceClass: Class<out Generator>
- val packageDocumentationBuilderServiceClass: Class<out PackageDocumentationBuilder>?
+ val formatServiceClass: KClass<out FormatService>?
+ val outlineServiceClass: KClass<out OutlineFormatService>?
+ val generatorServiceClass: KClass<out Generator>
+ val packageDocumentationBuilderClass: KClass<out PackageDocumentationBuilder>
+ val javaDocumentationBuilderClass: KClass<out JavaDocumentationBuilder>
}
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<out FormatService>
- get() = HtmlFormatService::class.java
+abstract class KotlinFormatDescriptorBase : FormatDescriptor {
+ override val packageDocumentationBuilderClass = KotlinPackageDocumentationBuilder::class
+ override val javaDocumentationBuilderClass = KotlinJavaDocumentationBuilder::class
- override val outlineServiceClass: Class<out OutlineFormatService>
- get() = HtmlFormatService::class.java
-
- override val generatorServiceClass: Class<out Generator>
- get() = FileGenerator::class.java
-
- override val packageDocumentationBuilderServiceClass: Class<out PackageDocumentationBuilder>?
- get() = null
+ override val generatorServiceClass = FileGenerator::class
}
-class KotlinWebsiteFormatDescriptor : FormatDescriptor {
- override val formatServiceClass: Class<out FormatService>
- get() = KotlinWebsiteFormatService::class.java
-
- override val outlineServiceClass: Class<out OutlineFormatService>
- get() = YamlOutlineService::class.java
-
- override val generatorServiceClass: Class<out Generator>
- get() = FileGenerator::class.java
-
- override val packageDocumentationBuilderServiceClass: Class<out PackageDocumentationBuilder>?
- get() = null
+class HtmlFormatDescriptor : KotlinFormatDescriptorBase() {
+ override val formatServiceClass = HtmlFormatService::class
+ override val outlineServiceClass = HtmlFormatService::class
}
-class JekyllFormatDescriptor : FormatDescriptor {
- override val formatServiceClass: Class<out FormatService>
- get() = JekyllFormatService::class.java
-
- override val outlineServiceClass: Class<out OutlineFormatService>?
- get() = null
-
- override val generatorServiceClass: Class<out Generator>
- get() = FileGenerator::class.java
-
- override val packageDocumentationBuilderServiceClass: Class<out PackageDocumentationBuilder>?
- 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<out FormatService>
- get() = MarkdownFormatService::class.java
-
- override val outlineServiceClass: Class<out OutlineFormatService>?
- get() = null
+class KotlinWebsiteFormatDescriptor : KotlinFormatDescriptorBase() {
+ override val formatServiceClass = KotlinWebsiteFormatService::class
+ override val outlineServiceClass = YamlOutlineService::class
+}
- override val generatorServiceClass: Class<out Generator>
- get() = FileGenerator::class.java
+class JekyllFormatDescriptor : KotlinFormatDescriptorBase() {
+ override val formatServiceClass = JekyllFormatService::class
+ override val outlineServiceClass = null
+}
- override val packageDocumentationBuilderServiceClass: Class<out PackageDocumentationBuilder>?
- get() = null
+class MarkdownFormatDescriptor : KotlinFormatDescriptorBase() {
+ override val formatServiceClass = MarkdownFormatService::class
+ override val outlineServiceClass = null
}