私は、int、文字列、および文字列[]をダンプする関数snakeyamlを作成しようとしています。物事を挿入できるように関数を記述する方法がわかりません。例えば何かを返す関数としてsnakeyamlを使用するにはどうすればよいですか?
:
public void testDump() {
Map<String, Object> data = new HashMap<String, Object>();
data.put("name", "Silenthand Olleander");
data.put("race", "Human");
data.put("traits", new String[] { "ONE_HAND", "ONE_EYE" });
Yaml yaml = new Yaml();
String output = yaml.dump(data);
System.out.println(output);
}
私は"name"
と"Silenthand Olleander"
のようなものが設定可能にする必要があります。私はまた、この機能が何を正確に知っていません。新しいファイルを作成しますか?既存のstrings.ymlファイルに行を追加する必要があるからです。だから私はこのようになりstring.ymlのフォーマットをしたいと思います:
#String.yml file
0 name_here The array of argument messages here.
1 name_here Another array of argument messages here.
2 name_here And again... I think you get the point.
@ T.J.Crowder Fixed。 – VinylScratch