Java 类org.bukkit.configuration.file.YamlConstructor 实例源码

项目:SCUtils    文件:Config.java   
public YamlConfigurationR() throws Exception {
  Field yamlOptionsField = YamlConfiguration.class.getDeclaredField("yamlOptions");
  yamlOptionsField.setAccessible(true);
  DumperOptionsR yamlOptions = new DumperOptionsR();
  yamlOptionsField.set(this, yamlOptions);

  Field yamlRepresenterField = YamlConfiguration.class.getDeclaredField("yamlRepresenter");
  yamlRepresenterField.setAccessible(true);
  YamlRepresenter yamlRepresenter = new YamlRepresenter();
  yamlRepresenterField.set(this, yamlRepresenter);

  Field yamlField = YamlConfiguration.class.getDeclaredField("yaml");
  yamlField.setAccessible(true);
  yamlField.set(this, new Yaml(new YamlConstructor(), yamlRepresenter, yamlOptions));
}