diff options
author | Sergey Mashkov <sergey.mashkov@jetbrains.com> | 2015-07-31 15:35:34 +0300 |
---|---|---|
committer | Sergey Mashkov <sergey.mashkov@jetbrains.com> | 2015-07-31 17:52:49 +0300 |
commit | e27fb69817b1417c1bc556a507b14f2700c7a736 (patch) | |
tree | b6d3b5622e65651ae6510f5109d86f834ff2c337 /src/Locations/FoldersLocationService.kt | |
parent | 12f91ee7d491b21359ff8e8822c594f35b904def (diff) | |
download | dokka-e27fb69817b1417c1bc556a507b14f2700c7a736.tar.gz dokka-e27fb69817b1417c1bc556a507b14f2700c7a736.tar.bz2 dokka-e27fb69817b1417c1bc556a507b14f2700c7a736.zip |
Use Guice injector and ServiceLocator to load implementations on the fly
Diffstat (limited to 'src/Locations/FoldersLocationService.kt')
-rw-r--r-- | src/Locations/FoldersLocationService.kt | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Locations/FoldersLocationService.kt b/src/Locations/FoldersLocationService.kt index e85c2c98..8a0cf6be 100644 --- a/src/Locations/FoldersLocationService.kt +++ b/src/Locations/FoldersLocationService.kt @@ -1,9 +1,12 @@ package org.jetbrains.dokka +import com.google.inject.Inject +import com.google.inject.name.Named import java.io.File public fun FoldersLocationService(root: String): FoldersLocationService = FoldersLocationService(File(root), "") -public class FoldersLocationService(val root: File, val extension: String) : FileLocationService { +public class FoldersLocationService @Inject constructor(@Named("outputDir") val root: File, val extension: String) : FileLocationService { + override fun withExtension(newExtension: String): FileLocationService { return if (extension.isEmpty()) FoldersLocationService(root, newExtension) else this } |