Get all nodes under YAML path

走远了吗. 提交于 2019-12-01 07:31:27
r4vn

To get the node IDs contained in Main:

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

Output:

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

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

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.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!