public final class YamlConfiguration extends FileConfiguration
Synchronized with the commit on 16-April-2023.
defs, options| Constructor and Description |
|---|
YamlConfiguration()
Constructs an empty YAML configuration with no default values.
|
YamlConfiguration(@Nullable Configuration defs)
Constructs an empty YAML configuration using the given configuration as a
source for all default values.
|
| Modifier and Type | Method and Description |
|---|---|
@NotNull YamlConfigurationOptions |
getOptions()
Gets the options for this configuration.
|
static @NotNull YamlConfiguration |
loadConfiguration(@NotNull File file)
Creates a new YAML configuration, loading from the given file.
|
static @NotNull YamlConfiguration |
loadConfiguration(@NotNull Reader reader)
Creates a new YAML configuration, loading from the given reader.
|
void |
loadFromString(@NotNull String data)
Loads this file configuration from the given string.
|
@NotNull String |
saveToString()
Converts this file configuration to a string.
|
load, load, load, save, saveaddDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaultsclear, contains, contains, createPath, createPath, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByte, getByte, getByteList, getChar, getChar, getCharList, getComments, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloat, getFloat, getFloatList, getInlineComments, getInt, getInt, getIntList, getKeys, getList, getList, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getRoot, getSerializable, getSerializable, getShort, getShort, getShortList, getString, getString, getStringList, getValues, isBoolean, isByte, isChar, isConfigurationSection, isDouble, isFloat, isInt, isList, isLong, isNumber, isSet, isShort, isString, set, setComments, setInlineComments, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, contains, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByte, getByte, getByteList, getChar, getChar, getCharList, getComments, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloat, getFloat, getFloatList, getInlineComments, getInt, getInt, getIntList, getKeys, getList, getList, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getRoot, getSerializable, getSerializable, getShort, getShort, getShortList, getString, getString, getStringList, getValues, isBoolean, isByte, isChar, isConfigurationSection, isDouble, isFloat, isInt, isList, isLong, isNumber, isSet, isShort, isString, set, setComments, setInlineCommentspublic YamlConfiguration()
FileConfiguration()public YamlConfiguration(@Nullable
@Nullable Configuration defs)
defs - The default value provider configurationFileConfiguration(Configuration)@NotNull public @NotNull String saveToString()
saveToString in class FileConfigurationpublic void loadFromString(@NotNull
@NotNull String data)
throws InvalidConfigurationException
All values contained in-memory in this file configuration will be removed, leaving only the file configuration options as well as any defaults. The new values will be loaded into memory from the given string.
loadFromString in class FileConfigurationdata - The string representation of the file configuration data to
load.InvalidConfigurationException - If the given string cannot be
parsed as a file configuration.@NotNull public @NotNull YamlConfigurationOptions getOptions()
All setters through this method are chainable.
getOptions in interface ConfigurationgetOptions in class FileConfiguration@NotNull public static @NotNull YamlConfiguration loadConfiguration(@NotNull @NotNull File file)
Any errors loading the YAML configuration will be logged and then otherwise ignored. If the given input is not a valid YAML configuration, an empty YAML configuration will be returned.
This will only load up to the default number of aliases
(YamlConfigurationOptions.getMaxAliases()) to prevent a Billion
Laughs Attack.
The encoding used may follow the system dependent default.
file - The file to load.@NotNull public static @NotNull YamlConfiguration loadConfiguration(@NotNull @NotNull Reader reader)
Any errors loading the YAML configuration will be logged and then otherwise ignored. If the given input is not a valid YAML configuration, an empty YAML configuration will be returned.
This will only load up to the default number of aliases
(YamlConfigurationOptions.getMaxAliases()) to prevent a Billion
Laughs Attack.
The encoding used may follow the system dependent default.
reader - The reader to load.Copyright © 2024 BSPF Systems, LLC. All rights reserved.