类 MemoryConfiguration
- 所有已实现的接口:
Configuration,ConfigurationSection
- 直接已知子类:
FileConfiguration
Configuration 的一种实现, 不会从任何数据源进行保存或加载, 所有值仅存储在内存中.
这对于临时的配置对象或提供默认值非常有用.-
字段概要
字段从类继承的字段 org.bukkit.configuration.MemorySection
map -
构造器概要
构造器构造器说明创建一个没有默认值的空MemoryConfiguration.MemoryConfiguration(@Nullable Configuration defaults) 创建一个空的MemoryConfiguration, 并使用指定的Configuration作为所有默认值的来源. -
方法概要
修饰符和类型方法说明voidaddDefault(@NotNull String path, @Nullable Object value) 给指定路径添加一个缺省值.voidaddDefaults(@NotNull Map<String, Object> defaults) 把指定map里面的键值都加入到缺省值列表.voidaddDefaults(@NotNull Configuration defaults) 把指定Configuration全部加入到缺省值列表.获取这个Configuration的缺省值Configuration.获取直接包含此ConfigurationSection的父ConfigurationSection.options()获取这个Configuration的ConfigurationOptions.voidsetDefaults(@NotNull Configuration defaults) 设置新的缺省值列表.从类继承的方法 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, toString从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 org.bukkit.configuration.ConfigurationSection
contains, contains, createSection, createSection, get, get, getBoolean, getBoolean, getBooleanList, getByteList, getCharacterList, getColor, getColor, getComments, 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, 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, setInlineComments
-
字段详细资料
-
defaults
-
options
-
-
构造器详细资料
-
MemoryConfiguration
public MemoryConfiguration()创建一个没有默认值的空MemoryConfiguration.原文: Creates an empty
MemoryConfigurationwith no default values. -
MemoryConfiguration
创建一个空的MemoryConfiguration, 并使用指定的Configuration作为所有默认值的来源.- 参数:
defaults- 默认值提供者- 抛出:
IllegalArgumentException- 如果 defaults 为 null 则抛出此异常
-
-
方法详细资料
-
addDefault
从接口复制的说明:ConfigurationSection给指定路径添加一个缺省值.如果缺省值
Configuration没有被提供, 则自动创建一个新的.如果值为 null, 表示从缺省值
Configuration中删除这个路径上的默认值如果
ConfigurationSection.getDefaultSection()返回的值为 null, 则建立一个新的原文: Sets the default value in the root at the given path as provided.
If no source
Configurationwas provided as a default collection, then a newMemoryConfigurationwill be created to hold the new default value.If value is null, the value will be removed from the default Configuration source.
If the value as returned by
ConfigurationSection.getDefaultSection()is null, then this will create a new section at the path, replacing anything that may have existed there previously.- 指定者:
addDefault在接口中Configuration- 指定者:
addDefault在接口中ConfigurationSection- 覆盖:
addDefault在类中MemorySection- 参数:
path- 要设置缺省值的路径.value- 要设置的值.
-
addDefaults
从接口复制的说明:Configuration把指定map里面的键值都加入到缺省值列表.如果没有缺省值
Configuration, 那么将会建立一个新的缺省值MemoryConfiguration用于保存.如果值为 null , 将会删除该路径上的缺省值.
原文: Sets the default values of the given paths as provided.
If no source
Configurationwas provided as a default collection, then a newMemoryConfigurationwill be created to hold the new default values.- 指定者:
addDefaults在接口中Configuration- 参数:
defaults- Map 的键是路径, 值是对应路径的值.
-
addDefaults
从接口复制的说明:Configuration把指定Configuration全部加入到缺省值列表.如果没有缺省值
Configuration, 那么将会建立一个新的MemoryConfiguration用于保存.你可以使用
Configuration.setDefaults(org.bukkit.configuration.Configuration)来设置缺省值列表来源.原文: Sets the default values of the given paths as provided.
If no source
Configurationwas provided as a default collection, then a newMemoryConfigurationwill be created to hold the new default value.If you require this, you should set the default source with
Configuration.setDefaults(org.bukkit.configuration.Configuration).- 指定者:
addDefaults在接口中Configuration- 参数:
defaults- 包含要复制的默认值列表的配置.
-
setDefaults
从接口复制的说明:Configuration设置新的缺省值列表.将直接替换原有的缺省值列表(如果有).
原文: Sets the source of all default values for this
Configuration.If a previous source was set, or previous default values were defined, then they will not be copied to the new source.
- 指定者:
setDefaults在接口中Configuration- 参数:
defaults- 新的Configuration.
-
getDefaults
从接口复制的说明:Configuration获取这个Configuration的缺省值Configuration.如果设置过缺省值, 即使没有设置缺省值列表, 也会返回
Configuration.如果都没有, 则返回 null.
原文: Gets the source
Configurationfor this configuration.If no configuration source was set, but default values were added, then a
MemoryConfigurationwill be returned. If no source was set and no defaults were set, then this method will return null.- 指定者:
getDefaults在接口中Configuration- 返回:
- 返回缺省值列表, 如果没有则返回 null.
-
getParent
从接口复制的说明:ConfigurationSection获取直接包含此ConfigurationSection的父ConfigurationSection.对于任何
Configuration自身, 将返回 null.如果该节因任何原因不再被包含在其父节中 (例如被替换为不同的值), 可能返回 null.
原文: Gets the parent
ConfigurationSectionthat directly contains thisConfigurationSection.For any
Configurationthemselves, this will return null.If the section is no longer contained within its parent for any reason, such as being replaced with a different value, this may return null.
- 指定者:
getParent在接口中ConfigurationSection- 覆盖:
getParent在类中MemorySection- 返回:
- 包含此节的父节.
-
options
从接口复制的说明:Configuration获取这个Configuration的ConfigurationOptions.如需修改配置,直接修改返回值即可.
原文: Gets the
ConfigurationOptionsfor thisConfiguration.All setters through this method are chainable.
- 指定者:
options在接口中Configuration- 返回:
- 这个配置文件的一些配置(格式之类的).
-