From b5b0a6898e94f753b87dab9dc136d6a983fd0989 Mon Sep 17 00:00:00 2001 From: Alexander Nozik Date: Sun, 26 Jul 2020 17:36:18 +0300 Subject: [PATCH] Add default implementation to the provider. --- .../commonMain/kotlin/hep/dataforge/context/AbstractPlugin.kt | 2 -- .../src/commonMain/kotlin/hep/dataforge/provider/Provider.kt | 4 +--- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/dataforge-context/src/commonMain/kotlin/hep/dataforge/context/AbstractPlugin.kt b/dataforge-context/src/commonMain/kotlin/hep/dataforge/context/AbstractPlugin.kt index e1041935..42adce2c 100644 --- a/dataforge-context/src/commonMain/kotlin/hep/dataforge/context/AbstractPlugin.kt +++ b/dataforge-context/src/commonMain/kotlin/hep/dataforge/context/AbstractPlugin.kt @@ -30,8 +30,6 @@ abstract class AbstractPlugin(override val meta: Meta = Meta.EMPTY) : Plugin { dependencies.add(factory) return PluginDependencyDelegate(factory.type) } - - override fun provideTop(target: String): Map = emptyMap() } fun Collection.toMap(): Map = associate { it.name to it } diff --git a/dataforge-context/src/commonMain/kotlin/hep/dataforge/provider/Provider.kt b/dataforge-context/src/commonMain/kotlin/hep/dataforge/provider/Provider.kt index 72484ea9..a1c2faa1 100644 --- a/dataforge-context/src/commonMain/kotlin/hep/dataforge/provider/Provider.kt +++ b/dataforge-context/src/commonMain/kotlin/hep/dataforge/provider/Provider.kt @@ -39,12 +39,10 @@ interface Provider { */ val defaultChainTarget: String get() = "" - /** * A map of direct children for specific target */ - fun provideTop(target: String): Map = - throw IllegalArgumentException("Target $target is not supported for $this") + fun provideTop(target: String): Map = emptyMap() } fun Provider.provide(path: Path, targetOverride: String? = null): Any? {