com.sk89q.util.yaml.YAMLProcessor.setHeader()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(142)

本文整理了Java中com.sk89q.util.yaml.YAMLProcessor.setHeader()方法的一些代码示例,展示了YAMLProcessor.setHeader()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YAMLProcessor.setHeader()方法的具体详情如下:
包路径:com.sk89q.util.yaml.YAMLProcessor
类名称:YAMLProcessor
方法名:setHeader

YAMLProcessor.setHeader介绍

[英]Set the header for the file. A header can be provided to prepend the YAML data output on configuration save. The header is printed raw and so must be manually commented if used. A new line will be appended after the header, however, if a header is provided.
[中]设置文件的标题。在配置保存时,可以提供一个头文件来预先输出YAML数据。标题是原始打印的,因此如果使用,必须手动注释。但是,如果提供了标题,则在标题后会追加一行。

代码示例

代码示例来源:origin: EngineHub/WorldEdit

/**
 * Set the header for the file as a series of lines that are terminated
 * by a new line sequence.
 *
 * @param headerLines header lines to prepend
 */
public void setHeader(String... headerLines) {
  StringBuilder header = new StringBuilder();
  for (String line : headerLines) {
    if (header.length() > 0) {
      header.append(LINE_BREAK);
    }
    header.append(line);
  }
  setHeader(header.toString());
}

代码示例来源:origin: EngineHub/WorldEdit

config.setHeader(CONFIG_HEADER);

代码示例来源:origin: EngineHub/WorldGuard

config.setHeader(CONFIG_HEADER);

代码示例来源:origin: EngineHub/WorldGuard

config.setHeader(FILE_HEADER);
config.save();

代码示例来源:origin: EngineHub/CommandBook

public WrappedSpawn setWorldSpawn(Location loc) {
  WrappedSpawn spawn = getEnrichment(loc.getWorld());
  loc.getWorld().setSpawnLocation(loc.getBlockX(), loc.getBlockY(), loc.getBlockZ());
  spawn.setPitch(loc.getPitch());
  spawn.setYaw(loc.getYaw());
  config.setProperty(spawn.getWorldName() + ".pitch", spawn.getPitch());
  config.setProperty(spawn.getWorldName() + ".yaw", spawn.getYaw());
  config.setHeader(CONFIG_HEADER);
  config.save();
  return spawn;
}

代码示例来源:origin: EngineHub/WorldGuard

config.setHeader(CONFIG_HEADER);

相关文章