Bukkit Configurations
API State: Stable
Unfinished
This part of the API is brand-new. It will be changed if there are any bugs, missing features or usability improvements.It is not recommended relying on this part of the API, it will most likely change.
Draft
Our own usage and testing has shown that this part of the API is complete and seems bug free. However, other plugins may have other use cases which are not covered by our testing. Therefore, please go ahead and use this API part. Let us know if there are missing features or bugs. This API part will be changed if there are more bugs, missing features or usability improvements.Please use this part of the API and give us feedback!
Stable
Both our own and third party testing showed that this part of the API is complete. Only bugs and major conceptual problems would lead to more changes.This part of the API should be safe to use. We try to keep it compatible with previous versions if changes are needed.
We implemented multiple different org.bukkit.configuration.ConfigurationSection
's and Configuration
's to make it
easier to work with configurations and to implement some new features.
We have the following implementations:
Decoratorπ
Basically a wrapper for a ConfigurationSection
simply delegating all calls to the wrapped section.
In that way, you can override specific methods without having to override all methods for custom implementations.
Mainly used for internal purposes, but can be used to create even more custom implementations.
org.betonquest.betonquest.api.bukkit.config.custom.ConfigurationSectionDecorator
Handleπ
Based on Decorator
. Handles any modifications to the configuration and wraps all values that are an instance
of ConfigurationSection
with the same implementation. This should prevent any modifications to the configuration
that are not done through the handler. This is the implementation actually used to create more custom implementations.
org.betonquest.betonquest.api.bukkit.config.custom.handle.HandleModificationConfiguration
org.betonquest.betonquest.api.bukkit.config.custom.handle.HandleModificationConfigurationSection
Unmodifiableπ
Based on Handle
. Makes the configuration unmodifiable. This means no values can be added, removed or modified.
Also, no new Sections can be created. All modifications throw a UnsupportedOperationException
.
org.betonquest.betonquest.api.bukkit.config.custom.unmodifiable.UnmodifiableConfiguration
org.betonquest.betonquest.api.bukkit.config.custom.unmodifiable.UnmodifiableConfigurationSection
Fallbackπ
This is a configuration buildup from two ConfigurationSection
's.
One is the original where all modifications are done, and the other one is the fallback configuration.
The fallback configuration is used to look up values that are not contained in the original configuration.
This is useful for default values or global configurations.
org.betonquest.betonquest.api.bukkit.config.custom.fallback.FallbackConfiguration
org.betonquest.betonquest.api.bukkit.config.custom.fallback.FallbackConfigurationSection
Multiπ
This is not a ConfigurationSection of bukkit, it is an additional interface.
This interface adds methods to manage configs that are build from multiple ConfigurationSection
's.
The MultiSectionConfiguration is an implementation of this interface that implements a merging method that does not
allow any conflicting values resulting in a KeyConflictException
.
If mismatching states or settings are found in one ConfigurationSection
a InvalidSubConfigurationException
is thrown.
org.betonquest.betonquest.api.bukkit.config.custom.multi.MultiConfiguration
org.betonquest.betonquest.api.bukkit.config.custom.multi.MultiSectionConfiguration
org.betonquest.betonquest.api.bukkit.config.custom.multi.KeyConflictException
org.betonquest.betonquest.api.bukkit.config.custom.multi.InvalidSubConfigurationException
Multi Fallbackπ
This is a Fallback configuration that also implements the MultiConfiguration interface. In this way, a multi configuration can have the advantage of a fallback configuration to look up values that are not contained in the original configuration.
org.betonquest.betonquest.api.bukkit.config.custom.multi.fallback.MultiFallbackConfiguration