LoaderScope

interface LoaderScope

DSL scope interface used within Yacla.withDefaults blocks.

This interface provides a way to define one or more configuration loaders that share a common set of defaults (parser, logger, auto-update settings).

Usage typically looks like:

Yacla.withDefaults(settings) {
loader<MyConfig> {
fromResource("/defaults/my.yml")
toFile(Paths.get("config/my.yml"))
}
}

Implementations like LoaderScopeImpl internally apply the shared settings and handle the loading lifecycle automatically.

Functions

Link copied to clipboard
abstract fun <T : Any> loader(clazz: KClass<T>, block: ConfigLoaderBuilder<T>.() -> Unit): ConfigLoader<T>

Creates and loads a configuration for the given class using the provided block.

Link copied to clipboard
inline fun <T : Any> LoaderScope.loader(noinline block: ConfigLoaderBuilder<T>.() -> Unit): ConfigLoader<T>

Creates a config loader for the specified class within a LoaderScope, applying shared defaults.