yaml格式
name: demo
desc: this is desc
items:
- name: item
desc: item desc
- name: item2
desc: desc2
maven
<dependency>
<groupId>com.github.sanjusoftware</groupId>
<artifactId>yamlbeans</artifactId>
<version>1.11</version>
</dependency>
bean
public class Demo{
private String name;
private String desc;
private List<Demo> items;
//getter setter
}
转换
ClassLoader classLoader = getClass().getClassLoader();
String path = classLoader.getResource("demo.yaml").getPath();
YamlReader reader = new YamlReader(new FileReader(path));
Demo demo = reader.read(Demo.class);
doc
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。