1 package org.jetbrains.dokka.Formats 2 3 import com.google.inject.Binder 4 import org.jetbrains.dokka.* 5 import org.jetbrains.dokka.KotlinAsJavaElementSignatureProvider 6 import org.jetbrains.dokka.KotlinElementSignatureProvider 7 import org.jetbrains.dokka.ElementSignatureProvider 8 import org.jetbrains.dokka.Samples.DefaultSampleProcessingService 9 import org.jetbrains.dokka.Samples.SampleProcessingService 10 import org.jetbrains.dokka.Utilities.bind 11 import org.jetbrains.dokka.Utilities.toType 12 import kotlin.reflect.KClass 13 14 15 interface DefaultAnalysisComponentServices { 16 val packageDocumentationBuilderClass: KClass<out PackageDocumentationBuilder> 17 val javaDocumentationBuilderClass: KClass<out JavaDocumentationBuilder> 18 val sampleProcessingService: KClass<out SampleProcessingService> 19 val elementSignatureProvider: KClass<out ElementSignatureProvider> 20 } 21 22 interface DefaultAnalysisComponent : FormatDescriptorAnalysisComponent, DefaultAnalysisComponentServices { <lambda>null23 override fun configureAnalysis(binder: Binder): Unit = with(binder) { 24 bind<ElementSignatureProvider>() toType elementSignatureProvider 25 bind<PackageDocumentationBuilder>() toType packageDocumentationBuilderClass 26 bind<JavaDocumentationBuilder>() toType javaDocumentationBuilderClass 27 bind<SampleProcessingService>() toType sampleProcessingService 28 } 29 } 30 31 32 object KotlinAsJava : DefaultAnalysisComponentServices { 33 override val packageDocumentationBuilderClass = KotlinAsJavaDocumentationBuilder::class 34 override val javaDocumentationBuilderClass = JavaPsiDocumentationBuilder::class 35 override val sampleProcessingService = DefaultSampleProcessingService::class 36 override val elementSignatureProvider = KotlinAsJavaElementSignatureProvider::class 37 } 38 39 40 object KotlinAsKotlin : DefaultAnalysisComponentServices { 41 override val packageDocumentationBuilderClass = KotlinPackageDocumentationBuilder::class 42 override val javaDocumentationBuilderClass = KotlinJavaDocumentationBuilder::class 43 override val sampleProcessingService = DefaultSampleProcessingService::class 44 override val elementSignatureProvider = KotlinElementSignatureProvider::class 45 }