public final class YamlConfiguration extends FileConfiguration
Configuration which saves all files in
Yaml. Please note that this implementation is not synchronized.
Synchronized with the commit on 09-Oct-2022.
defs, optionsmap| Constructor and Description |
|---|
YamlConfiguration()
Creates an empty
YamlConfiguration with no default values. |
YamlConfiguration(@Nullable Configuration defs)
Creates an empty
YamlConfiguration using the specified
Configuration as a source for all default values. |
| Modifier and Type | Method and Description |
|---|---|
@NotNull YamlConfigurationOptions |
getOptions()
Gets the
ConfigurationOptions for this Configuration. |
static @NotNull YamlConfiguration |
loadConfiguration(@NotNull File file)
Creates a new
YamlConfiguration, loading from the given
File. |
static @NotNull YamlConfiguration |
loadConfiguration(@NotNull Reader reader)
Creates a new
YamlConfiguration, loading from the given
Reader. |
void |
loadFromString(@NotNull String data)
Loads this
FileConfiguration from the given String. |
@NotNull YamlConfigurationOptions |
options()
Deprecated.
|
@NotNull String |
saveToString()
Saves this
FileConfiguration to a String, and returns it. |
buildHeader, load, load, load, save, saveaddDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaultscontains, contains, createPath, createPath, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByte, getByte, getByteList, getChar, getChar, getCharList, getComments, getConfigurationSection, getCurrentPath, getDefault, 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, isSet, isShort, isString, mapChildrenKeys, mapChildrenValues, 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, isSet, isShort, isString, set, setComments, setInLineCommentspublic YamlConfiguration()
YamlConfiguration with no default values.FileConfiguration()public YamlConfiguration(@Nullable
@Nullable Configuration defs)
YamlConfiguration using the specified
Configuration as a source for all default values.defs - A Configuration containing the values to use as
defaults.FileConfiguration(Configuration)@NotNull public @NotNull String saveToString()
FileConfiguration to a String, and returns it.saveToString in class FileConfigurationString containing this FileConfiguration.public void loadFromString(@NotNull
@NotNull String data)
throws InvalidConfigurationException
FileConfiguration from the given String.
All values contained in-memory in this FileConfiguration will be
removed, leaving only the FileConfigurationOptions as well as any
defaults. The new values will be loaded into memory from the
String.
loadFromString in class FileConfigurationdata - A String representation of the
FileConfiguration data to load.InvalidConfigurationException - If the given String cannot
be parsed as a
FileConfiguration.@NotNull public @NotNull YamlConfigurationOptions getOptions()
ConfigurationOptions for this Configuration.
All setters through this method are chainable.
getOptions in interface ConfigurationgetOptions in class FileConfigurationConfigurationOptions for this Configuration.@Deprecated @NotNull public @NotNull YamlConfigurationOptions options()
Please use Configuration.getOptions() instead; it provides the
same functionality.
options in interface Configurationoptions in class FileConfigurationConfigurationOptions for this Configuration.Configuration.getOptions()@NotNull public static @NotNull YamlConfiguration loadConfiguration(@NotNull @NotNull File file)
YamlConfiguration, loading from the given
File.
Any errors loading the YamlConfiguration will be logged and then
ignored. If the specified input is not a valid YamlConfiguration,
a blank YamlConfiguration 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.YamlConfiguration.@NotNull public static @NotNull YamlConfiguration loadConfiguration(@NotNull @NotNull Reader reader)
YamlConfiguration, loading from the given
Reader.
Any errors loading the YamlConfiguration will be logged and then
ignored. If the specified input is not a valid YamlConfiguration,
a blank YamlConfiguration 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.YamlConfiguration.Copyright © 2022 BSPF Systems, LLC. All rights reserved.