Package me.qscbm.inlayx.config
Class CommentConfiguration
java.lang.Object
org.bukkit.configuration.MemorySection
org.bukkit.configuration.MemoryConfiguration
org.bukkit.configuration.file.FileConfiguration
org.bukkit.configuration.file.YamlConfiguration
me.qscbm.inlayx.config.CommentConfiguration
- All Implemented Interfaces:
org.bukkit.configuration.Configuration,org.bukkit.configuration.ConfigurationSection
public class CommentConfiguration
extends org.bukkit.configuration.file.YamlConfiguration
保存时保留配置文件注释的Yaml实例
会以KV的形式存储
”'__comment__ # 注释内容': comment"的格式存储
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final intprotected static final Stringprotected static final Patternprotected static final Patternprotected static final Stringprotected static final Patternprotected static final Patternprotected static final StringFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetComment(String key) 获取指定 key 同级且位于其上方的注释.voidinsertComment(String key, String value) 设置注释static booleanisCommentByKeys(String key) voidloadFromString(String contents) @NonNull StringMethods inherited from class org.bukkit.configuration.file.YamlConfiguration
loadConfiguration, loadConfiguration, optionsMethods 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
-
Field Details
-
COMMENT_PREFIX_SYMBOL
- See Also:
-
COMMENT_SUFFIX_SYMBOL
- See Also:
-
COMMENT_INDEX_SEPARATOR
- See Also:
-
COMMENT_BODY_PREFIX
- See Also:
-
LOADED_COMMENT_PATTERN
-
FROM_REGEX
- See Also:
-
FROM_PATTERN
-
TO_REGEX
- See Also:
-
TO_PATTERN
-
COUNT_SPACE_PATTERN
-
COMMENT_SPLIT_WIDTH
protected static final int COMMENT_SPLIT_WIDTH- See Also:
-
-
Constructor Details
-
CommentConfiguration
public CommentConfiguration()
-
-
Method Details
-
loadFromString
public void loadFromString(String contents) throws org.bukkit.configuration.InvalidConfigurationException - Overrides:
loadFromStringin classorg.bukkit.configuration.file.YamlConfiguration- Throws:
org.bukkit.configuration.InvalidConfigurationException
-
saveToString
- Overrides:
saveToStringin classorg.bukkit.configuration.file.YamlConfiguration
-
getComment
获取指定 key 同级且位于其上方的注释. -
insertComment
设置注释 -
isCommentByKeys
-