0
我有我通過Java創建的yaml
文件。Java:使用SnakeYaml時如何避免噪聲冗餘?
--- !!com.test.users.Configuration
config:
userList: !!set
? name: John
age: 18
: null
? name: Axel
age: 14
: null
defaultUser:
name: Bob
age: 15
這裏是我的SnakeYML代碼
DumperOptions options = new DumperOptions();
options.setDefaultScalarStyle(DumperOptions.ScalarStyle.PLAIN);
options.setPrettyFlow(true);
options.setDefaultFlowStyle(DumperOptions.FlowStyle.BLOCK);
options.setAllowReadOnlyProperties(true);
options.setExplicitStart(true);
yml = new Yaml(options);
FileWriter writer = new FileWriter(path);
yml.dump(obj, writer);
的問題是如何排除這些多餘!!noise com.test.users.Configuration
,?
,: null
,!!set
?