int, string 및 string []을 덤프하는 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가 수정되었습니다. – VinylScratch