Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/311.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 如何使用SnakeYAML将值获取到数组中_Java_Yaml_Snakeyaml - Fatal编程技术网

Java 如何使用SnakeYAML将值获取到数组中

Java 如何使用SnakeYAML将值获取到数组中,java,yaml,snakeyaml,Java,Yaml,Snakeyaml,假设我有: item: field: value another: another 我是否有办法将其以如下形式放入数组中: [value, another] 在java中使用SnakeYAML是否可以省去很多麻烦 item: [value, another] 或 item: - value - another

假设我有:

item:
  field: value
  another: another
我是否有办法将其以如下形式放入数组中:

[value, another]
在java中使用SnakeYAML是否可以省去很多麻烦

item: [value, another]

item:
  - value
  - another