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

    Fields inherited from class org.simpleyaml.configuration.file.YamlConfiguration

    BLANK_CONFIG

    Fields inherited from class org.simpleyaml.configuration.MemoryConfiguration

    defaults, options

    Fields inherited from class org.simpleyaml.configuration.MemorySection

    map

    Fields inherited from interface org.simpleyaml.configuration.comments.Commentable

    COMMENT_PREFIX
  • 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
    void addDefault​(java.lang.String key, java.lang.Object value)
    Adds a default to the config file and activates copy-defaults option
    void addDefaults​(java.util.Map<java.lang.String,​java.lang.Object> configuration)
    Adds multiple default entries and activates copy-defaults option
    void addDefaults​(org.simpleyaml.configuration.Configuration configuration)
    Adds multiple default entries and activates copy-defaults option
    java.lang.String getName()
    Get name of config
    void setName​(java.lang.String name)
    Sets name of the config

    Methods 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, toString

    Methods inherited from class org.simpleyaml.configuration.file.YamlConfiguration

    buildHeader, convertMapsToSections, dump, options, parseHeader

    Methods inherited from class org.simpleyaml.configuration.file.FileConfiguration

    load, load, load, load, save, save, write

    Methods inherited from class org.simpleyaml.configuration.MemoryConfiguration

    getDefaults, getParent, setDefaults

    Methods 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, set

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface org.simpleyaml.configuration.comments.Commentable

    getComment, setComment

    Methods 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.InvalidConfigurationException
      Creates / Loads a config file
      Parameters:
      file - file of the config
      name - name of the config
      Throws:
      java.io.IOException - thrown if file could not been found
      org.simpleyaml.exceptions.InvalidConfigurationException - thrown if file is invalid
  • Method Details

    • getName

      public java.lang.String getName()
      Get name of config
      Specified by:
      getName in interface org.simpleyaml.configuration.ConfigurationSection
      Overrides:
      getName in class org.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:
      addDefault in interface org.simpleyaml.configuration.Configuration
      Specified by:
      addDefault in interface org.simpleyaml.configuration.ConfigurationSection
      Overrides:
      addDefault in class org.simpleyaml.configuration.MemoryConfiguration
      Parameters:
      key - Key of the default entry
      value - 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:
      addDefaults in interface org.simpleyaml.configuration.Configuration
      Overrides:
      addDefaults in class org.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:
      addDefaults in interface org.simpleyaml.configuration.Configuration
      Overrides:
      addDefaults in class org.simpleyaml.configuration.MemoryConfiguration
      Parameters:
      configuration - Map with the default entries