package org.jetbrains.dokka.Formats import com.google.inject.Binder import org.jetbrains.dokka.* import org.jetbrains.dokka.Utilities.bind import org.jetbrains.dokka.Utilities.lazyBind import org.jetbrains.dokka.Utilities.toOptional import org.jetbrains.dokka.Utilities.toType import kotlin.reflect.KClass interface FormatDescriptorAnalysisComponent { fun configureAnalysis(binder: Binder) } interface FormatDescriptorOutputComponent { fun configureOutput(binder: Binder) } interface FormatDescriptor : FormatDescriptorAnalysisComponent, FormatDescriptorOutputComponent abstract class FileGeneratorBasedFormatDescriptor : FormatDescriptor { override fun configureOutput(binder: Binder): Unit = with(binder) { bind() toType NodeLocationAwareGenerator::class bind() toType generatorServiceClass bind() toType languageServiceClass lazyBind() toOptional (outlineServiceClass) lazyBind() toOptional formatServiceClass lazyBind() toOptional packageListServiceClass } abstract val formatServiceClass: KClass? abstract val outlineServiceClass: KClass? abstract val generatorServiceClass: KClass abstract val packageListServiceClass: KClass? open val languageServiceClass: KClass = KotlinLanguageService::class }