GeneralSettings
General settings cover all options related to documents in general.
Last updated
General settings cover all options related to documents in general.
Last updated
Settings introduced by BoostedYAML follow builder design pattern, e.g. you may build your own settings using:
Sets the key format to use; specifies how the loaded/supplied keys should be formatted.
KeyFormat.STRING
- allows only strings as keys.
All keys loaded are converted to strings via (e.g. 5
-> "5"
), except null
keys, which are considered illegal and will throw an . Please note that such conversion is irrevocable upon saving.
This key format ensures compatibility with Spigot/BungeeCord API.
KeyFormat.OBJECT
- allows anything as the key per the YAML specification (that is, integers, strings, doubles...).
Preserves keys as they were loaded by SnakeYAML Engine (YAML processor), or supplied.
Default: KeyFormat.STRING
Sets route separator used to separate individual keys inside a string route and vice-versa.
Default: '.'
(compatible with Spigot/BungeeCord API)
Sets serializer used for custom object serialization/deserialization. You can read more about serializers here:
Sets if to enable use of the defaults by section methods (if any are present).
Not effective if there are no defaults associated with the document.
If enabled, bulk getter methods (which return a set/map of all keys, routes, values, blocks) will not only include content from the file, but also from the equivalent section in the defaults. Value getters with signature getX(route)
will search the defaults as documented.
If disabled, none of the section methods will interact with the defaults. This is recommended if you would like to handle all value absences (present in the defaults, but not in the file) and invalid values manually - e.g. notifying the user and then using the default value defined within final
fields, or obtained via Section#getDefaults()
.
Defaults used by section methods which don't provide default parameter and have general syntax of Section#getX(Route)
.
For exact specification regarding which method returns which of these defaults, please visit corresponding method docs.
Defaults that are also present in Spigot/BungeeCord API are the same by default.
Defaults used also during document loading.
Default: with ==
set as the serialized type key
Make sure to implement the correct artifact and setSpigotSerializer.getInstance()
for compatiblity. You can then continue registering your custom classes to .
Default: object: null
, number: 0
, string: null
, char: ' '
, boolean: false
, list: supplier of , set: supplier of , map: supplier of .
For example, if there is a list in the document (unless it has a explicitly specified which determines the exact type), it's contents are loaded into a list supplied by the default list supplier.
Default: list: supplier of , set: supplier of , map: supplier of .