Package me.a8kj.config
Class AutoReadYamlSource
- All Implemented Interfaces:
CreatableConfig<String>,CRUDOperations<String>,DeletableConfig<String>,ReadableConfig<String>,UpdatableConfig<String>
Provides an automated YAML configuration source that triggers
a read operation immediately after creation.
Extends YamlSource to seamlessly load configuration data
upon file initialization without requiring manual invocation.
Any exceptions during the auto-read process are logged using
Log.error(String, Object...).
- Since:
- 0.3
- Author:
- a8kj7sea
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidonPostCreate(ConfigFile<String> config) Invoked immediately after the configuration file has been created.Methods inherited from class me.a8kj.config.YamlSource
read, updateMethods inherited from class me.a8kj.config.file.BaseConfig
create, delete, getReader, getWriter, onPostDelete, onPreCreate, onPreDelete
-
Constructor Details
-
AutoReadYamlSource
public AutoReadYamlSource()
-
-
Method Details
-
onPostCreate
Invoked immediately after the configuration file has been created.This method automatically reads the configuration from the YAML source, ensuring that the
ConfigFileis populated and ready for use. Any exceptions encountered during reading are caught and logged.- Overrides:
onPostCreatein classBaseConfig<String>- Parameters:
config- theConfigFilecontext being initialized
-