Package de.kelanisystem.kelaniconfig
Class KelaniYamlFile
java.lang.Object
org.simpleyaml.configuration.MemorySection
org.simpleyaml.configuration.MemoryConfiguration
org.simpleyaml.configuration.file.FileConfiguration
org.simpleyaml.configuration.file.YamlConfiguration
org.simpleyaml.configuration.file.YamlFile
de.kelanisystem.kelaniconfig.KelaniYamlFile
- All Implemented Interfaces:
org.simpleyaml.configuration.comments.Commentable,org.simpleyaml.configuration.Configuration,org.simpleyaml.configuration.ConfigurationSection
public class KelaniYamlFile
extends org.simpleyaml.configuration.file.YamlFile
-
Field Summary
-
Constructor Summary
Constructors Constructor Description KelaniYamlFile(java.io.File file, java.lang.String name)Creates / Loads a config file -
Method Summary
Modifier and Type Method Description voidaddDefault(java.lang.String key, java.lang.Object value)Adds a default to the config file and activates copy-defaults optionvoidaddDefaults(java.util.Map<java.lang.String,java.lang.Object> configuration)Adds multiple default entries and activates copy-defaults optionvoidaddDefaults(org.simpleyaml.configuration.Configuration configuration)Adds multiple default entries and activates copy-defaults optionjava.lang.StringgetName()Get name of configvoidsetName(java.lang.String name)Sets name of the configMethods inherited from class org.simpleyaml.configuration.file.YamlFile
copyTo, copyTo, createNewFile, createOrLoad, createOrLoadWithComments, deleteFile, exists, fileToString, getComment, getConfigurationFile, getFilePath, getSize, load, loadConfiguration, loadConfiguration, loadConfiguration, loadConfiguration, loadConfiguration, loadConfiguration, loadFromString, loadWithComments, save, saveToString, setComment, setConfigurationFile, setConfigurationFile, setConfigurationFile, toStringMethods inherited from class org.simpleyaml.configuration.file.YamlConfiguration
buildHeader, convertMapsToSections, dump, options, parseHeaderMethods inherited from class org.simpleyaml.configuration.file.FileConfiguration
load, load, load, load, save, save, writeMethods inherited from class org.simpleyaml.configuration.MemoryConfiguration
getDefaults, getParent, setDefaultsMethods inherited from class org.simpleyaml.configuration.MemorySection
contains, createPath, createPath, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getConfigurationSection, getCurrentPath, getDefault, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInt, getInt, getIntegerList, getKeys, getList, getList, getLong, getLong, getLongList, getMapList, getMapValues, getRoot, getShortList, getString, getString, getStringList, getValues, isBoolean, isConfigurationSection, isDouble, isInt, isList, isLong, isPrimitiveWrapper, isSet, isString, mapChildrenKeys, mapChildrenValues, setMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.simpleyaml.configuration.comments.Commentable
getComment, setCommentMethods inherited from interface org.simpleyaml.configuration.ConfigurationSection
contains, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInt, getInt, getIntegerList, getKeys, getList, getList, getLong, getLong, getLongList, getMapList, getMapValues, getRoot, getShortList, getString, getString, getStringList, getValues, isBoolean, isConfigurationSection, isDouble, isInt, isList, isLong, isSet, isString, remove, set
-
Constructor Details
-
KelaniYamlFile
public KelaniYamlFile(java.io.File file, java.lang.String name) throws java.io.IOException, org.simpleyaml.exceptions.InvalidConfigurationExceptionCreates / Loads a config file- Parameters:
file- file of the configname- name of the config- Throws:
java.io.IOException- thrown if file could not been foundorg.simpleyaml.exceptions.InvalidConfigurationException- thrown if file is invalid
-
-
Method Details
-
getName
public java.lang.String getName()Get name of config- Specified by:
getNamein interfaceorg.simpleyaml.configuration.ConfigurationSection- Overrides:
getNamein classorg.simpleyaml.configuration.MemorySection- Returns:
- name of config
-
setName
public void setName(java.lang.String name)Sets name of the config- Parameters:
name- desired name
-
addDefault
public void addDefault(java.lang.String key, java.lang.Object value)Adds a default to the config file and activates copy-defaults option- Specified by:
addDefaultin interfaceorg.simpleyaml.configuration.Configuration- Specified by:
addDefaultin interfaceorg.simpleyaml.configuration.ConfigurationSection- Overrides:
addDefaultin classorg.simpleyaml.configuration.MemoryConfiguration- Parameters:
key- Key of the default entryvalue- Value of the default entry
-
addDefaults
public void addDefaults(org.simpleyaml.configuration.Configuration configuration)Adds multiple default entries and activates copy-defaults option- Specified by:
addDefaultsin interfaceorg.simpleyaml.configuration.Configuration- Overrides:
addDefaultsin classorg.simpleyaml.configuration.MemoryConfiguration- Parameters:
configuration- Configuration with the default entries
-
addDefaults
public void addDefaults(java.util.Map<java.lang.String,java.lang.Object> configuration)Adds multiple default entries and activates copy-defaults option- Specified by:
addDefaultsin interfaceorg.simpleyaml.configuration.Configuration- Overrides:
addDefaultsin classorg.simpleyaml.configuration.MemoryConfiguration- Parameters:
configuration- Map with the default entries
-