gpt4 book ai didi

org.yaml.snakeyaml.Yaml.parse()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-18 04:10:40 27 4
gpt4 key购买 nike

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

Yaml.parse介绍

[英]Parse a YAML stream and produce parsing events.
[中]解析YAML流并生成解析事件。

代码示例

代码示例来源:origin: geotools/geotools

for (Event evt : YamlUtil.getSafeYaml().parse(input)) {
  YsldValidateHandler h = context.peek();

代码示例来源:origin: jenkinsci/kubernetes-ci-plugin

private static String findManifestKind(String yamlAsText) {

    final Yaml yaml = new Yaml();
    final StringReader stringReader = new StringReader(yamlAsText);
    final Iterable<Event> parse = yaml.parse(stringReader);
    boolean kindFound = false;
    int countBetween = 0;
    String kind = null;
    for (Event event : parse) {
      if (kindFound) {
        countBetween++;
      }
      if (event.is(Event.ID.Scalar)) {
        ScalarEvent scalarEvent = (ScalarEvent)event;
        final String value = scalarEvent.getValue();
        if (countBetween == 1) {
          kind = value;
          break;
        }
        if (value.equals("kind")) {
          kindFound = true;
          continue;
        }

      }
    }

    return kind;
  }
}

代码示例来源:origin: org.milyn/milyn-smooks-all

Iterable<Event> yamlEventStream = yaml.parse(yamlStreamReader);

代码示例来源:origin: org.dhatim/milyn-smooks-yaml

Iterable<Event> yamlEventStream = yaml.parse(yamlStreamReader);

代码示例来源:origin: sonatype-nexus-community/nexus-repository-helm

Emitter emitter = new Emitter(writer, new DumperOptions());
boolean rewrite = false;
for (Event event : yaml.parse(reader)) {
 if (event instanceof ScalarEvent) {
  ScalarEvent scalarEvent = (ScalarEvent) event;

代码示例来源:origin: smooks/smooks

Iterable<Event> yamlEventStream = yaml.parse(yamlStreamReader);

代码示例来源:origin: org.milyn/milyn-smooks-yaml

Iterable<Event> yamlEventStream = yaml.parse(yamlStreamReader);

代码示例来源:origin: org.virtuslab/milyn-smooks-yaml

Iterable<Event> yamlEventStream = yaml.parse(yamlStreamReader);

代码示例来源:origin: com.onpositive.aml/org.aml.registry

public boolean loadDependencies(String str, boolean inUses, boolean waitUses, boolean readKey,
    HashSet<String> includes) throws IOException {
  Iterable<Event> parse = new Yaml().parse(new StringReader(str));
  try {
    for (Event e : parse) {

代码示例来源:origin: org.geotools/gt-ysld

for (Event evt : YamlUtil.getSafeYaml().parse(input)) {
  YsldValidateHandler h = context.peek();

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