public class YamlConfiguration extends FileConfiguration
Configuration which saves all files in Yaml.
Note that this implementation is not synchronized.SYSTEM_UTF, UTF_BIG, UTF8_OVERRIDE| Constructor and Description |
|---|
YamlConfiguration() |
| Modifier and Type | Method and Description |
|---|---|
static YamlConfiguration |
loadConfiguration(File file)
Creates a new
YamlConfiguration, loading from the given file. |
static YamlConfiguration |
loadConfiguration(InputStream stream)
Deprecated.
does not properly consider encoding
|
static YamlConfiguration |
loadConfiguration(Reader reader)
Creates a new
YamlConfiguration, loading from the given reader. |
void |
loadFromString(String contents)
Loads this
FileConfiguration from the specified string, as
opposed to from file. |
YamlConfigurationOptions |
options()
Gets the
ConfigurationOptions for this Configuration. |
String |
saveToString()
Saves this
FileConfiguration to a string, and returns it. |
load, load, load, load, save, saveaddDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaultscontains, createPath, createPath, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloat, getFloat, getFloatList, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLong, getLong, getLongList, getMapList, getName, getOfflinePlayer, getOfflinePlayer, getRoot, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isFloat, isInt, isItemStack, isList, isLong, isOfflinePlayer, isSet, isString, isVector, set, toStringequals, getClass, hashCode, notify, notifyAll, wait, wait, waitcontains, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloat, getFloat, getFloatList, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLong, getLong, getLongList, getMapList, getName, getOfflinePlayer, getOfflinePlayer, getRoot, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isFloat, isInt, isItemStack, isList, isLong, isOfflinePlayer, isSet, isString, isVector, setpublic String saveToString()
FileConfigurationFileConfiguration to a string, and returns it.saveToString in class FileConfigurationpublic void loadFromString(String contents) throws InvalidConfigurationException
FileConfigurationFileConfiguration from the specified string, as
opposed to from file.
All the values contained within this configuration will be removed, leaving only settings and defaults, and the new values will be loaded from the given string.
If the string is invalid in any way, an exception will be thrown.
loadFromString in class FileConfigurationcontents - Contents of a Configuration to load.InvalidConfigurationException - Thrown if the specified string is
invalid.public YamlConfigurationOptions options()
ConfigurationConfigurationOptions for this Configuration.
All setters through this method are chainable.
options in interface Configurationoptions in class FileConfigurationpublic static YamlConfiguration loadConfiguration(File file)
YamlConfiguration, loading from the given file.
Any errors loading the Configuration will be logged and then ignored. If the specified input is not a valid config, a blank config will be returned.
The encoding used may follow the system dependent default.
file - Input fileIllegalArgumentException - Thrown if file is null@Deprecated public static YamlConfiguration loadConfiguration(InputStream stream)
YamlConfiguration, loading from the given stream.
Any errors loading the Configuration will be logged and then ignored. If the specified input is not a valid config, a blank config will be returned.
stream - Input streamIllegalArgumentException - Thrown if stream is nullFileConfiguration.load(InputStream),
loadConfiguration(Reader)public static YamlConfiguration loadConfiguration(Reader reader)
YamlConfiguration, loading from the given reader.
Any errors loading the Configuration will be logged and then ignored. If the specified input is not a valid config, a blank config will be returned.
reader - inputIllegalArgumentException - Thrown if stream is nullCopyright © 2022. All rights reserved.