| 23 | private static Logger log = LogManager.getLogger(Parser.class); |
| 24 | private static HashMap<String,ASTType> hashMap = new HashMap<>(); |
| 25 | public void parse(String content,String filetype,boolean img) { |
| 26 | log.info("开始解析文件"); |
| 27 | log.info("准备环境"); |
| 28 | hashMap.put("DOT",new ASTDot()); |
| 29 | hashMap.put("JSON",new ASTJSON()); |
| 30 | hashMap.put("XML",new ASTXML()); |
| 31 | hashMap.put("YAML",new ASTYaml()); |
| 32 | hashMap.get(filetype).handle(content, ConstatField.ASTHomeTemp + File.separator + System.nanoTime() + "." + filetype.toLowerCase()); |
| 33 | if (filetype.contains("DOT") && img) { |
| 34 | log.info("dot转化图片"); |
| 35 | DotHandler dotHandler = new DotHandler(); |
| 36 | dotHandler.ImageHandler(); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | } |