java类org.bukkit.configuration.file.YamlConstructor的实例源码

Config.java 文件源码 项目:SCUtils 阅读 20 收藏 0 点赞 0 评论 0
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));
}


问题


面经


文章

微信
公众号

扫码关注公众号