Class YamlConfiguration
- All Implemented Interfaces:
- Configuration,- ConfigurationSection
public class YamlConfiguration extends FileConfiguration
Configuration which saves all files in Yaml.
 Note that this implementation is not synchronized.- 
Field SummaryFields Modifier and Type Field Description protected static StringBLANK_CONFIGprotected static StringCOMMENT_PREFIX
- 
Constructor SummaryConstructors Constructor Description YamlConfiguration()
- 
Method SummaryModifier and Type Method Description protected StringbuildHeader()Compiles the header for thisFileConfigurationand returns the result.protected voidconvertMapsToSections(Map<?,?> input, ConfigurationSection section)static YamlConfigurationloadConfiguration(File file)Creates a newYamlConfiguration, loading from the given file.static YamlConfigurationloadConfiguration(Reader reader)Creates a newYamlConfiguration, loading from the given reader.voidloadFromString(String contents)Loads thisFileConfigurationfrom the specified string, as opposed to from file.YamlConfigurationOptionsoptions()Gets theConfigurationOptionsfor thisConfiguration.protected StringparseHeader(String input)StringsaveToString()Saves thisFileConfigurationto a string, and returns it.Methods inherited from class org.bukkit.configuration.file.FileConfigurationload, load, load, save, saveMethods inherited from class org.bukkit.configuration.MemoryConfigurationaddDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaultsMethods inherited from class org.bukkit.configuration.MemorySectioncontains, contains, createPath, createPath, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getConfigurationSection, getCurrentPath, getDefault, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLocation, getLocation, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getOfflinePlayer, getOfflinePlayer, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLocation, isLong, isOfflinePlayer, isPrimitiveWrapper, isSet, isString, isVector, mapChildrenKeys, mapChildrenValues, set, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bukkit.configuration.ConfigurationSectioncontains, contains, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLocation, getLocation, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getOfflinePlayer, getOfflinePlayer, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLocation, isLong, isOfflinePlayer, isSet, isString, isVector, set
- 
Field Details- 
COMMENT_PREFIX- See Also:
- Constant Field Values
 
- 
BLANK_CONFIG- See Also:
- Constant Field Values
 
 
- 
- 
Constructor Details- 
YamlConfigurationpublic YamlConfiguration()
 
- 
- 
Method Details- 
saveToStringDescription copied from class:FileConfigurationSaves thisFileConfigurationto a string, and returns it.- Specified by:
- saveToStringin class- FileConfiguration
- Returns:
- String containing this configuration.
 
- 
loadFromStringDescription copied from class:FileConfigurationLoads thisFileConfigurationfrom 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. - Specified by:
- loadFromStringin class- FileConfiguration
- Parameters:
- contents- Contents of a Configuration to load.
- Throws:
- InvalidConfigurationException- Thrown if the specified string is invalid.
 
- 
convertMapsToSectionsprotected void convertMapsToSections(@NotNull Map<?,?> input, @NotNull ConfigurationSection section)
- 
parseHeader
- 
buildHeaderDescription copied from class:FileConfigurationCompiles the header for thisFileConfigurationand returns the result.This will use the header from FileConfiguration.options()->FileConfigurationOptions.header(), respecting the rules ofFileConfigurationOptions.copyHeader()if set.- Specified by:
- buildHeaderin class- FileConfiguration
- Returns:
- Compiled header
 
- 
optionsDescription copied from interface:ConfigurationGets theConfigurationOptionsfor thisConfiguration.All setters through this method are chainable. - Specified by:
- optionsin interface- Configuration
- Overrides:
- optionsin class- FileConfiguration
- Returns:
- Options for this configuration
 
- 
loadConfigurationCreates a newYamlConfiguration, 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. - Parameters:
- file- Input file
- Returns:
- Resulting configuration
- Throws:
- IllegalArgumentException- Thrown if file is null
 
- 
loadConfigurationCreates a newYamlConfiguration, 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. - Parameters:
- reader- input
- Returns:
- resulting configuration
- Throws:
- IllegalArgumentException- Thrown if stream is null
 
 
-