gpt4 book ai didi

com.esotericsoftware.yamlbeans.YamlConfig.()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 15:24:40 26 4
gpt4 key购买 nike

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

YamlConfig.<init>介绍

暂无

代码示例

代码示例来源:origin: EsotericSoftware/yamlbeans

public YamlWriter (Writer writer) {
  this(writer, new YamlConfig());
}

代码示例来源:origin: EsotericSoftware/yamlbeans

public YamlReader (Reader reader) {
  this(reader, new YamlConfig());
}

代码示例来源:origin: com.esotericsoftware.yamlbeans/yamlbeans

public YamlWriter (Writer writer) {
  this(writer, new YamlConfig());
}

代码示例来源:origin: com.esotericsoftware.yamlbeans/yamlbeans

public YamlReader (Reader reader) {
  this(reader, new YamlConfig());
}

代码示例来源:origin: mbechler/marshalsec

/**
 * {@inheritDoc}
 *
 * @see marshalsec.MarshallerBase#marshal(java.lang.Object)
 */
@Override
public String marshal ( Object o ) throws Exception {
  YamlConfig yc = new YamlConfig();
  StringWriter sw = new StringWriter();
  YamlWriter w = new YamlWriter(sw, yc);
  w.write(o);
  return sw.toString();
}

代码示例来源:origin: mbechler/marshalsec

/**
 * {@inheritDoc}
 *
 * @see marshalsec.MarshallerBase#unmarshal(java.lang.Object)
 */
@Override
public Object unmarshal ( String data ) throws Exception {
  YamlConfig yc = new YamlConfig();
  YamlReader r = new YamlReader(data, yc);
  return r.read();
}

代码示例来源:origin: org.lorislab.hugoup/hugoup

public static <T> T readFile(String file, Class<T> clazz) throws Exception {
  YamlConfig yamlConfig = new YamlConfig();
  yamlConfig.readConfig.setClassTags(false);
  YamlReader reader = new YamlReader(new FileReader(file));
  return reader.read(clazz);        
}

代码示例来源:origin: org.lorislab.hugoup/hugoup

public static String toString(Object data) throws Exception {
  YamlConfig yamlConfig = new YamlConfig();
  yamlConfig.writeConfig.setWriteClassname(YamlConfig.WriteClassName.NEVER);
  StringWriter w = new StringWriter();
  YamlWriter writer = new YamlWriter(w, yamlConfig);
  writer.write(data);
  writer.close();          
  return w.toString();
}

代码示例来源:origin: org.lorislab.hugoup/hugoup

public static void writeFile(String file, Object data) throws Exception {
    YamlConfig yamlConfig = new YamlConfig();
    yamlConfig.writeConfig.setWriteClassname(YamlConfig.WriteClassName.NEVER);
    YamlWriter writer = new YamlWriter(new FileWriter(file), yamlConfig);
    writer.write(data);
    writer.close();        
  }
}

代码示例来源:origin: org.cloudfoundry/cloudfoundry-client-lib

protected void saveTokensToFile(TargetInfos targetInfos) {
  final File tokensFile = getTokensFile();
  tokensFile.getParentFile().mkdirs();
  try {
    FileWriter fileWriter = new FileWriter(tokensFile);
    YamlConfig config = new YamlConfig();
    config.writeConfig.setAlwaysWriteClassname(false);
    config.writeConfig.setWriteRootElementTags(false);
    config.writeConfig.setWriteRootTags(false);
    config.writeConfig.setExplicitFirstDocument(true);
    YamlWriter yamlWriter = new YamlWriter(fileWriter, config);
    yamlWriter.write(targetInfos);
    yamlWriter.close();
    fileWriter.close();
  } catch (IOException e) {
    throw new RuntimeException("An error occurred writing the tokens file at " +
        tokensFile.getPath() + ":" + e.getMessage(), e);
  }
}

代码示例来源:origin: com.sap.cloud.lm.sl/cloudfoundry-client-lib

protected void saveTokensToFile(TargetInfos targetInfos) {
    final File tokensFile = getTokensFile();
    tokensFile.getParentFile()
      .mkdirs();
    try {
      FileWriter fileWriter = new FileWriter(tokensFile);

      YamlConfig config = new YamlConfig();
      config.writeConfig.setAlwaysWriteClassname(false);
      config.writeConfig.setWriteRootElementTags(false);
      config.writeConfig.setWriteRootTags(false);
      config.writeConfig.setExplicitFirstDocument(true);
      YamlWriter yamlWriter = new YamlWriter(fileWriter, config);

      yamlWriter.write(targetInfos);

      yamlWriter.close();
      fileWriter.close();
    } catch (IOException e) {
      throw new RuntimeException("An error occurred writing the tokens file at " + tokensFile.getPath() + ":" + e.getMessage(), e);
    }
  }
}

代码示例来源:origin: tomzo/gocd-yaml-config-plugin

public void parseStream(JsonConfigCollection result, InputStream input, String location) {
    try (InputStreamReader contentReader = new InputStreamReader(input)) {
      if (input.available() < 1) {
        result.addError("File is empty", location);
        return;
      }

      YamlConfig config = new YamlConfig();
      config.setAllowDuplicates(false);
      YamlReader reader = new YamlReader(contentReader, config);
      Object rootObject = reader.read();
      JsonConfigCollection filePart = rootTransform.transform(rootObject, location);
      result.append(filePart);
    } catch (YamlReader.YamlReaderException e) {
      result.addError(e.getMessage(), location);
    } catch (IOException e) {
      result.addError(e.getMessage() + " : " + e.getCause().getMessage() + " : ", location);
    }
  }
}

代码示例来源:origin: tomzo/gocd-yaml-config-plugin

public static Object readYamlObject(String path) throws IOException {
  YamlConfig config = new YamlConfig();
  config.setAllowDuplicates(false);
  YamlReader reader = new YamlReader(TestUtils.createReader(path), config);
  return reader.read();
}

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com