import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import org.yaml.snakeyaml.Yaml;
/**
* @Description: yml转化map,ps:int类型value不识别
* @author xu_fxiang@163.com
* @date 2019年12月17日 上午9:39:51
*/
public class YamlAnalyzeUtil {
public static Map<String, String> changeYmlToMap(String yml) {
Map<String, String> res = new HashMap<>();
Yaml yaml = new Yaml();
Iterator<Object> result = yaml.loadAll(yml).iterator();
while(result.hasNext()){
Map map=(Map)result.next();
iteratorYml(map, null, res);
}
return res;
}
private static void iteratorYml(Map map,String key, Map<String, String> res){