DefaultConfigLoaderBuilder

Default implementation of ConfigLoaderBuilder.

This builder creates a ConfigLoader for the given configuration class, allowing fluent configuration of the input resource, target file, parser, logger, and update behavior.

Typically used internally via net.ririfa.yacla.Yacla.loader, rather than instantiated directly.

Parameters

T

the type of the configuration object

Constructors

Link copied to clipboard
constructor(clazz: Class<T>)

Functions

Link copied to clipboard
open override fun autoUpdateIfOutdated(enabled: Boolean): ConfigLoaderBuilder<T>

Enables or disables automatic config updates based on resource version.

Link copied to clipboard
open override fun defaultLanguage(language: String): ConfigLoaderBuilder<T>

Sets the fallback language used when the selected localized resource does not exist.

Link copied to clipboard
open override fun fromResource(path: String): ConfigLoaderBuilder<T>

Specifies the path to the resource file (or directory root for locale resolution) bundled with the application. Used as a fallback or for initial creation.

Link copied to clipboard
open override fun language(language: String): ConfigLoaderBuilder<T>

Sets the language used when resolving localized resources.

Link copied to clipboard

Selects whether localized resources are copied to a single file or one file per language.

Link copied to clipboard
open override fun load(): ConfigLoader<T>

Builds and loads the config, returning a ConfigLoader instance.

Link copied to clipboard
open override fun outputLanguages(vararg languages: String): ConfigLoaderBuilder<T>

Sets the languages copied when languageOutputMode is LanguageOutputMode.MULTIPLE_FILES.

Link copied to clipboard
open override fun parser(parser: ConfigParser): ConfigLoaderBuilder<T>

Sets the parser used to read and write the config file.

Link copied to clipboard
open override fun pull(file: Path): ConfigLoaderBuilder<T>

Resolves a localized resource using the configured language.

open override fun pull(locale: String, file: Path): ConfigLoaderBuilder<T>

Resolves a locale-specific resource file and sets the output path.

Link copied to clipboard
open override fun systemLanguage(): ConfigLoaderBuilder<T>

Uses the current JVM locale when resolving localized resources.

Link copied to clipboard
open override fun toFile(file: Path): ConfigLoaderBuilder<T>

Sets the file where the configuration will be loaded from or saved to.

Link copied to clipboard
Link copied to clipboard
open override fun withLogger(logger: YaclaLogger): ConfigLoaderBuilder<T>

Sets the logger used for informational and error messages.