Configuration, ConfigurationSectionpublic class YamlConfiguration extends FileConfiguration
Configuration which saves all files in Yaml.
Note that this implementation is not synchronized.| Modifier and Type | Field | Description |
|---|---|---|
protected static java.lang.String |
BLANK_CONFIG |
|
protected static java.lang.String |
COMMENT_PREFIX |
defaults, optionsmap| Constructor | Description |
|---|---|
YamlConfiguration() |
| Modifier and Type | Method | Description |
|---|---|---|
protected java.lang.String |
buildHeader() |
Compiles the header for this
FileConfiguration and returns the
result. |
protected void |
convertMapsToSections(java.util.Map<?,?> input,
ConfigurationSection section) |
|
static YamlConfiguration |
loadConfiguration(java.io.File file) |
Creates a new
YamlConfiguration, loading from the given file. |
static YamlConfiguration |
loadConfiguration(java.io.Reader reader) |
Creates a new
YamlConfiguration, loading from the given reader. |
void |
loadFromString(java.lang.String contents) |
Loads this
FileConfiguration from the specified string, as
opposed to from file. |
YamlConfigurationOptions |
options() |
Gets the
ConfigurationOptions for this Configuration. |
protected java.lang.String |
parseHeader(java.lang.String input) |
|
java.lang.String |
saveToString() |
Saves this
FileConfiguration to a string, and returns it. |
contains, 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, getLong, getLong, getLongList, getMapList, getName, getOfflinePlayer, getOfflinePlayer, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLong, isOfflinePlayer, isSet, isString, isVector, setload, load, load, save, saveaddDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaultscontains, 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, getLong, getLong, getLongList, getMapList, getName, getOfflinePlayer, getOfflinePlayer, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLong, isOfflinePlayer, isPrimitiveWrapper, isSet, isString, isVector, mapChildrenKeys, mapChildrenValues, set, toStringprotected static final java.lang.String COMMENT_PREFIX
protected static final java.lang.String BLANK_CONFIG
public java.lang.String saveToString()
FileConfigurationFileConfiguration to a string, and returns it.saveToString in class FileConfigurationpublic void loadFromString(java.lang.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.protected void convertMapsToSections(java.util.Map<?,?> input,
ConfigurationSection section)
protected java.lang.String parseHeader(java.lang.String input)
protected java.lang.String buildHeader()
FileConfigurationFileConfiguration and returns the
result.
This will use the header from FileConfiguration.options() -> FileConfigurationOptions.header(), respecting the rules of FileConfigurationOptions.copyHeader() if set.
buildHeader in class FileConfigurationpublic YamlConfigurationOptions options()
ConfigurationConfigurationOptions for this Configuration.
All setters through this method are chainable.
options in interface Configurationoptions in class FileConfigurationpublic static YamlConfiguration loadConfiguration(java.io.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 filejava.lang.IllegalArgumentException - Thrown if file is nullpublic static YamlConfiguration loadConfiguration(java.io.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 - inputjava.lang.IllegalArgumentException - Thrown if stream is nullCopyright © 2018. All rights reserved.