- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.esotericsoftware.yamlbeans.YamlWriter.<init>()
方法的一些代码示例,展示了YamlWriter.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YamlWriter.<init>()
方法的具体详情如下:
包路径:com.esotericsoftware.yamlbeans.YamlWriter
类名称:YamlWriter
方法名:<init>
暂无
代码示例来源:origin: FlowCI/flow-platform
/**
* T to Yml
*
* @param t object
* @return String
*/
public static <T> String toYml(T t) {
Map<String, Object> map = new HashMap<>();
Object o = toObject(t);
map.put("flow", o);
String yml;
try (Writer stringWriter = new StringWriter()) {
YamlWriter writer = new YamlWriter(stringWriter, yamlConfig);
writer.write(map);
yml = stringWriter.toString();
} catch (Throwable throwable) {
throw new YmlParseException(YML_CONVERT_MESSAGE, throwable);
}
return yml;
}
}
代码示例来源:origin: stackoverflow.com
// let YamlWriter write its contents to an in-memory buffer
StringWriter temp = new StringWriter();
YamlWriter yamlOut = new YamlWriter(temp);
yamlOut.write(someObject);
// then dump the in-memory buffer out to a file, manipulating lines that
// start with a dash
PrintWriter out = new PrintWriter(new FileWriter(new File("someoutput.dat")));
LineNumberReader in = new LineNumberReader(new StringReader(temp.toString()));
String line;
while ((line = in.readLine()) != null) {
if (line.startsWith("-")) {
line = line.substring(1);
}
out.println(line);
}
代码示例来源: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: dariober/ASCIIGenome
YamlWriter writer = new YamlWriter(new FileWriter(outYaml));
writer.write(asciigenome_history);
writer.close();
代码示例来源: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: audit4j/audit4j-core
/**
* {@inheritDoc}
*
*/
@Override
public void generateConfig(T config, String filePath) throws ConfigurationException {
YamlWriter writer;
try {
writer = new YamlWriter(new FileWriter(filePath));
writer.getConfig().setClassTag(clazz.getSimpleName(), clazz);
writer.write(Configuration.DEFAULT);
writer.close();
} catch (IOException e) {
throw new ConfigurationException("Configuration Exception", "CONF_002");
}
}
代码示例来源: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: stackoverflow.com
YamlWriter writer = new YamlWriter(w);
writer.write(p1);
writer.close();
本文整理了Java中com.esotericsoftware.yamlbeans.YamlReader类的一些代码示例,展示了YamlReader类的具体用法。这些代码示例主要来源于Github/St
本文整理了Java中com.esotericsoftware.yamlbeans.YamlConfig类的一些代码示例,展示了YamlConfig类的具体用法。这些代码示例主要来源于Github/St
本文整理了Java中com.esotericsoftware.yamlbeans.YamlWriter类的一些代码示例,展示了YamlWriter类的具体用法。这些代码示例主要来源于Github/St
我一直在使用 Jackson 库对 Java 类进行序列化/反序列化。 Jackson 的一个绝妙功能是 @JsonIgnore 注释。您使用此注释向 Jackson 序列化代码指示它应该在自省(in
我正在使用 yamlbeans 将 yaml 文件反序列化为 Java 对象。只要我只有一节课,这就可以正常工作。问题是当我想嵌套一个字段时,我不得不在 yaml 描述中指定嵌套类。 单类示例: Ja
本文整理了Java中com.esotericsoftware.yamlbeans.YamlReader.close()方法的一些代码示例,展示了YamlReader.close()的具体用法。这些代码
本文整理了Java中com.esotericsoftware.yamlbeans.YamlReader.getConfig()方法的一些代码示例,展示了YamlReader.getConfig()的具
本文整理了Java中com.esotericsoftware.yamlbeans.YamlReader.()方法的一些代码示例,展示了YamlReader.()的具体用法。这些代码示例主要来源于Git
本文整理了Java中com.esotericsoftware.yamlbeans.YamlReader.read()方法的一些代码示例,展示了YamlReader.read()的具体用法。这些代码示例
本文整理了Java中com.esotericsoftware.yamlbeans.YamlConfig.setAllowDuplicates()方法的一些代码示例,展示了YamlConfig.setA
本文整理了Java中com.esotericsoftware.yamlbeans.YamlConfig.()方法的一些代码示例,展示了YamlConfig.()的具体用法。这些代码示例主要来源于Git
本文整理了Java中com.esotericsoftware.yamlbeans.YamlWriter.write()方法的一些代码示例,展示了YamlWriter.write()的具体用法。这些代码
本文整理了Java中com.esotericsoftware.yamlbeans.YamlWriter.close()方法的一些代码示例,展示了YamlWriter.close()的具体用法。这些代码
本文整理了Java中com.esotericsoftware.yamlbeans.YamlWriter.()方法的一些代码示例,展示了YamlWriter.()的具体用法。这些代码示例主要来源于Git
我需要配置 yamlbeans 处理类的方式。我想将 privateFields 设置为 true 以使用非 transient 字段。为此我需要什么?我应该创建哪个文件以及在其中放置什么内容?我使用
抱歉,我没有给出这么好的标题。这是我的 yml (databases.yml) default: #Default host - localhost host: localhost
我是一名优秀的程序员,十分优秀!