程序包 org.bukkit.configuration.file

# 类 YamlConfiguration

java.lang.Object
org.bukkit.configuration.MemorySection
org.bukkit.configuration.MemoryConfiguration
org.bukkit.configuration.file.FileConfiguration
org.bukkit.configuration.file.YamlConfiguration

所有已实现的接口:
  `Configuration`, `ConfigurationSection`

public class YamlConfiguration extends FileConfiguration
An implementation of `Configuration` which saves all files in Yaml. Note that this implementation is not synchronized.

- ## 字段概要

  字段
  修饰符和类型
  字段
  说明
  `protected static final String`
  `BLANK_CONFIG`
  已过时。
  unused, not intended to be API
  `protected static final String`
  `COMMENT_PREFIX`
  已过时。
  unused, not intended to be API

  ### 从类继承的字段 org.bukkit.configuration.MemoryConfiguration

  `defaults, options`

  ### 从类继承的字段 org.bukkit.configuration.MemorySection

  `map`

- ## 构造器概要

  构造器
  构造器
  说明
  `YamlConfiguration()`

- ## 方法概要

  修饰符和类型
  方法
  说明
  `static @NotNull YamlConfiguration`
  `loadConfiguration(@NotNull File file)`
  Creates a new `YamlConfiguration`, loading from the given file.
  `static @NotNull YamlConfiguration`
  `loadConfiguration(@NotNull Reader reader)`
  Creates a new `YamlConfiguration`, loading from the given reader.
  `void`
  `loadFromString(@NotNull String contents)`
  Loads this `FileConfiguration` from the specified string, as opposed to from file.
  `@NotNull YamlConfigurationOptions`
  `options()`
  获取这个 `Configuration` 的 `ConfigurationOptions`.
  `@NotNull String`
  `saveToString()`
  将这个 `FileConfiguration` 转化为String对象并且返回

  ### 从类继承的方法 org.bukkit.configuration.file.FileConfiguration

  `buildHeader, load, load, load, save, save`

  ### 从类继承的方法 org.bukkit.configuration.MemoryConfiguration

  `addDefault, addDefaults, addDefaults, getDefaults, getParent, setDefaults`

  ### 从类继承的方法 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`

- ## 字段详细资料

  - ### COMMENT_PREFIX

    @Deprecated protected static final String COMMENT_PREFIX
    已过时。
    unused, not intended to be API
    另请参阅:
      - 常量字段值

  - ### BLANK_CONFIG

    @Deprecated protected static final String BLANK_CONFIG
    已过时。
    unused, not intended to be API
    另请参阅:
      - 常量字段值

- ## 构造器详细资料

  - ### YamlConfiguration

    public YamlConfiguration()

- ## 方法详细资料

  - ### saveToString

    @NotNull public @NotNull String saveToString()
    从类复制的说明: `FileConfiguration`
    将这个 `FileConfiguration` 转化为String对象并且返回
    指定者:
      `saveToString` 在类中 `FileConfiguration`
    返回:
      这个FileConfiguration包含的所有String

  - ### loadFromString

    public void loadFromString(@NotNull @NotNull String contents) throws InvalidConfigurationException
    从类复制的说明: `FileConfiguration`
    Loads this `FileConfiguration` from the specified string, as opposed to from file.

    All the values contained within this configuration will be removed, leaving only settings and defaults, and the new values will be loaded from the given string.

    If the string is invalid in any way, an exception will be thrown.

    指定者:
      `loadFromString` 在类中 `FileConfiguration`
    参数:
      `contents` - Contents of a Configuration to load.
    抛出:
      `InvalidConfigurationException` - Thrown if the specified string is invalid.

  - ### options

    @NotNull public @NotNull YamlConfigurationOptions options()
    从接口复制的说明: `Configuration`
    获取这个 `Configuration` 的 `ConfigurationOptions`.

    如需修改配置,直接修改返回值即可.

    原文: Gets the `ConfigurationOptions` for this `Configuration`.

    All setters through this method are chainable.

    指定者:
      `options` 在接口中 `Configuration`
    覆盖:
      `options` 在类中 `FileConfiguration`
    返回:
      这个配置文件的一些配置(格式之类的).

  - ### loadConfiguration

    @NotNull public static @NotNull YamlConfiguration loadConfiguration(@NotNull @NotNull File file)
    Creates a new `YamlConfiguration`, loading from the given file.

    Any errors loading the Configuration will be logged and then ignored. If the specified input is not a valid config, a blank config will be returned.

    The encoding used may follow the system dependent default.

    参数:
      `file` - Input file
    返回:
      Resulting configuration
    抛出:
      `IllegalArgumentException` - Thrown if file is null

  - ### loadConfiguration

    @NotNull public static @NotNull YamlConfiguration loadConfiguration(@NotNull @NotNull Reader reader)
    Creates a new `YamlConfiguration`, loading from the given reader.

    Any errors loading the Configuration will be logged and then ignored. If the specified input is not a valid config, a blank config will be returned.

    参数:
      `reader` - input
    返回:
      resulting configuration
    抛出:
      `IllegalArgumentException` - Thrown if stream is null