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)); }