Package com.palmergames.bukkit.config
Class CommentedConfiguration
java.lang.Object
org.bukkit.configuration.MemorySection
org.bukkit.configuration.MemoryConfiguration
org.bukkit.configuration.file.FileConfiguration
org.bukkit.configuration.file.YamlConfiguration
com.palmergames.bukkit.config.CommentedConfiguration
- All Implemented Interfaces:
org.bukkit.configuration.Configuration,org.bukkit.configuration.ConfigurationSection
public class CommentedConfiguration
extends org.bukkit.configuration.file.YamlConfiguration
- Author:
- dumptruckman, Articdive, LlmDl
-
Field Summary
Fields inherited from class org.bukkit.configuration.file.YamlConfiguration
BLANK_CONFIG, COMMENT_PREFIXFields inherited from class org.bukkit.configuration.MemoryConfiguration
defaults, optionsFields inherited from class org.bukkit.configuration.MemorySection
map -
Constructor Summary
ConstructorsConstructorDescriptionCommentedConfiguration(File file) Create a new CommentedConfiguration using the given file, using Towny's Logger for any error messages.CommentedConfiguration(Path path) Create a new CommentedConfiguration using the file at the given path, using Towny's Logger for any error messages.CommentedConfiguration(Path path, Logger logger) CommentedConfiguration(Path path, org.bukkit.plugin.Plugin plugin) Create a new CommentedConfiguration using the file at the given path, for the given plugin. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComment(String path, String... commentLines) Stores a comment for the specified Configuration path.booleanload()Load the yaml configuration file into memory.voidsave()Save the yaml configuration file from memory to file.Methods inherited from class org.bukkit.configuration.file.YamlConfiguration
loadConfiguration, loadConfiguration, loadFromString, options, saveToStringMethods inherited from class org.bukkit.configuration.file.FileConfiguration
buildHeader, load, load, load, save, saveMethods inherited from class org.bukkit.configuration.MemoryConfiguration
addDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaultsMethods inherited from class org.bukkit.configuration.MemorySection
contains, contains, createPath, createPath, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getComments, getConfigurationSection, getCurrentPath, getDefault, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInlineComments, 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, setComments, setInlineComments, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.bukkit.configuration.ConfigurationSection
contains, contains, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getComments, getComponent, getComponent, getConfigurationSection, getCurrentPath, getDefaultSection, getDouble, getDouble, getDoubleList, getFloatList, getInlineComments, getInt, getInt, getIntegerList, getItemStack, getItemStack, getKeys, getList, getList, getLocation, getLocation, getLong, getLong, getLongList, getMapList, getName, getObject, getObject, getOfflinePlayer, getOfflinePlayer, getRichMessage, getRichMessage, getRoot, getSerializable, getSerializable, getShortList, getString, getString, getStringList, getValues, getVector, getVector, isBoolean, isColor, isConfigurationSection, isDouble, isInt, isItemStack, isList, isLocation, isLong, isOfflinePlayer, isSet, isString, isVector, set, setComments, setComponent, setInlineComments, setRichMessage
-
Constructor Details
-
CommentedConfiguration
-
CommentedConfiguration
Create a new CommentedConfiguration using the file at the given path, using Towny's Logger for any error messages. -
CommentedConfiguration
Create a new CommentedConfiguration using the file at the given path, for the given plugin. Plugin's own Logger will be used for any error messages. -
CommentedConfiguration
Create a new CommentedConfiguration using the given file, using Towny's Logger for any error messages.
-
-
Method Details
-
load
public boolean load()Load the yaml configuration file into memory.- Returns:
- true if file is able to load.
-
save
public void save()Save the yaml configuration file from memory to file. -
addComment
Stores a comment for the specified Configuration path. The comment can be multiple lines. An empty string will indicate a blank line.- Parameters:
path- Configuration path to add comment.commentLines- Comments to add. One String per line.
-