|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.bukkit.configuration.MemorySection org.bukkit.configuration.MemoryConfiguration org.bukkit.configuration.file.FileConfiguration org.bukkit.configuration.file.YamlConfiguration
public class YamlConfiguration
An implementation of Configuration
which saves all files in Yaml.
Note that this implementation is not synchronized.
Field Summary | |
---|---|
protected static String |
BLANK_CONFIG
|
protected static String |
COMMENT_PREFIX
|
Fields inherited from class org.bukkit.configuration.MemoryConfiguration |
---|
defaults, options |
Fields inherited from class org.bukkit.configuration.MemorySection |
---|
map |
Constructor Summary | |
---|---|
YamlConfiguration()
|
Method Summary | |
---|---|
protected String |
buildHeader()
Compiles the header for this FileConfiguration and returns the result. |
protected void |
convertMapsToSections(Map<?,?> input,
ConfigurationSection section)
|
static YamlConfiguration |
loadConfiguration(File file)
Creates a new YamlConfiguration , loading from the given file. |
static YamlConfiguration |
loadConfiguration(InputStream stream)
Creates a new YamlConfiguration , loading from the given stream. |
void |
loadFromString(String contents)
Loads this FileConfiguration from the specified string, as opposed to from file. |
YamlConfigurationOptions |
options()
Gets the ConfigurationOptions for this Configuration . |
protected String |
parseHeader(String input)
|
String |
saveToString()
Saves this FileConfiguration to a string, and returns it. |
Methods inherited from class org.bukkit.configuration.file.FileConfiguration |
---|
load, load, load, save, save |
Methods inherited from class org.bukkit.configuration.MemoryConfiguration |
---|
addDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaults |
Methods inherited from class org.bukkit.configuration.MemorySection |
---|
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, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLong, isOfflinePlayer, isPrimitiveWrapper, isSet, isString, isVector, mapChildrenKeys, mapChildrenValues, set, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.bukkit.configuration.ConfigurationSection |
---|
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, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLong, isOfflinePlayer, isSet, isString, isVector, set |
Field Detail |
---|
protected static final String COMMENT_PREFIX
protected static final String BLANK_CONFIG
Constructor Detail |
---|
public YamlConfiguration()
Method Detail |
---|
public String saveToString()
FileConfiguration
FileConfiguration
to a string, and returns it.
saveToString
in class FileConfiguration
public void loadFromString(String contents) throws InvalidConfigurationException
FileConfiguration
FileConfiguration
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 FileConfiguration
contents
- Contents of a Configuration to load.
InvalidConfigurationException
- Thrown if the specified string is invalid.protected void convertMapsToSections(Map<?,?> input, ConfigurationSection section)
protected String parseHeader(String input)
protected String buildHeader()
FileConfiguration
FileConfiguration
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 FileConfiguration
public YamlConfigurationOptions options()
Configuration
ConfigurationOptions
for this Configuration
.
All setters through this method are chainable.
options
in interface Configuration
options
in class FileConfiguration
public 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.
file
- Input file
IllegalArgumentException
- Thrown if file is nullpublic 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 stream
IllegalArgumentException
- Thrown if stream is null
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |