• <bdo id='I32ap'></bdo><ul id='I32ap'></ul>

    1. <i id='I32ap'><tr id='I32ap'><dt id='I32ap'><q id='I32ap'><span id='I32ap'><b id='I32ap'><form id='I32ap'><ins id='I32ap'></ins><ul id='I32ap'></ul><sub id='I32ap'></sub></form><legend id='I32ap'></legend><bdo id='I32ap'><pre id='I32ap'><center id='I32ap'></center></pre></bdo></b><th id='I32ap'></th></span></q></dt></tr></i><div id='I32ap'><tfoot id='I32ap'></tfoot><dl id='I32ap'><fieldset id='I32ap'></fieldset></dl></div>

        <legend id='I32ap'><style id='I32ap'><dir id='I32ap'><q id='I32ap'></q></dir></style></legend>
      1. <small id='I32ap'></small><noframes id='I32ap'>

      2. <tfoot id='I32ap'></tfoot>

        获取 YAML 路径下的所有节点

        时间:2023-09-26
      3. <i id='hxnie'><tr id='hxnie'><dt id='hxnie'><q id='hxnie'><span id='hxnie'><b id='hxnie'><form id='hxnie'><ins id='hxnie'></ins><ul id='hxnie'></ul><sub id='hxnie'></sub></form><legend id='hxnie'></legend><bdo id='hxnie'><pre id='hxnie'><center id='hxnie'></center></pre></bdo></b><th id='hxnie'></th></span></q></dt></tr></i><div id='hxnie'><tfoot id='hxnie'></tfoot><dl id='hxnie'><fieldset id='hxnie'></fieldset></dl></div>
          <bdo id='hxnie'></bdo><ul id='hxnie'></ul>
            <tbody id='hxnie'></tbody>

            <tfoot id='hxnie'></tfoot>

                  <small id='hxnie'></small><noframes id='hxnie'>

                  <legend id='hxnie'><style id='hxnie'><dir id='hxnie'><q id='hxnie'></q></dir></style></legend>
                  本文介绍了获取 YAML 路径下的所有节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有一个如下所示的 YAML 文件:

                  I have a YAML file that looks like this:

                  Main:
                    topofhouse:
                      x: 276.4375
                      y: 71.0
                      z: -60.5
                      yaw: -290.7768
                      pitch: 35.400017
                    2ndfloor:
                      x: 276.5
                      y: 67.0
                      z: -60.5
                      yaw: -8.626648
                      pitch: 16.199997
                    home:
                      x: 276.5
                      y: 63.0
                      z: -60.5
                      yaw: -18.976715
                      pitch: -32.850002
                  

                  有没有办法获取Main下的所有节点?

                  Is there a way to get all nodes under Main?

                  推荐答案

                  获取Main中包含的节点ID:

                  To get the node IDs contained in Main:

                  file.getConfigurationSection("Main").getKeys(false);
                  

                  输出:

                  Set["topofhouse", "2ndfloor", "home"]
                  

                  ConfigurationSection.getConfigurationSection(String path) 方法用于获取要操作的路径.

                  The ConfigurationSection.getConfigurationSection(String path) method is used to get the path on which to operate.

                  ConfigurationSection.getKeys(boolean deep) 方法会将当前路径中的所有节点 ID 作为 Set 获取.当 deep 设置为 true 时,它也会获取所有子节点和子子节点中的所有节点,但是它们之间的所有关系都会丢失.

                  The ConfigurationSection.getKeys(boolean deep) method will get you all node IDs within the current path as a Set<String>. When deep is set to true, it will get all the nodes in the children and subchildren too, however, all relations between them will be lost.

                  这篇关于获取 YAML 路径下的所有节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:您如何在 Java 中实际解析 YAML 中的值? 下一篇:Spring Boot + Yaml + @PropertySource + @ConfigurationProperti

                  相关文章

                  最新文章

                  <tfoot id='Tgu9Y'></tfoot>
                  <legend id='Tgu9Y'><style id='Tgu9Y'><dir id='Tgu9Y'><q id='Tgu9Y'></q></dir></style></legend>

                    1. <small id='Tgu9Y'></small><noframes id='Tgu9Y'>

                        <bdo id='Tgu9Y'></bdo><ul id='Tgu9Y'></ul>
                      <i id='Tgu9Y'><tr id='Tgu9Y'><dt id='Tgu9Y'><q id='Tgu9Y'><span id='Tgu9Y'><b id='Tgu9Y'><form id='Tgu9Y'><ins id='Tgu9Y'></ins><ul id='Tgu9Y'></ul><sub id='Tgu9Y'></sub></form><legend id='Tgu9Y'></legend><bdo id='Tgu9Y'><pre id='Tgu9Y'><center id='Tgu9Y'></center></pre></bdo></b><th id='Tgu9Y'></th></span></q></dt></tr></i><div id='Tgu9Y'><tfoot id='Tgu9Y'></tfoot><dl id='Tgu9Y'><fieldset id='Tgu9Y'></fieldset></dl></div>