| | |
| | | import org.jdom2.Document; |
| | | import org.jdom2.Element; |
| | | import org.jdom2.input.SAXBuilder; |
| | | |
| | | import org.springframework.core.io.Resource; |
| | | import org.springframework.core.io.ResourceLoader; |
| | | |
| | | public class TreeParse { |
| | | public List<String> ids ; |
| | |
| | | /** |
| | | * 解析处理器配置 |
| | | * @return |
| | | */ |
| | | protected TreeConfig parseConfig() { |
| | | try { |
| | | ClassLoader classLoader = ClassLoader.getSystemClassLoader(); |
| | |
| | | return null; |
| | | } |
| | | } |
| | | */ |
| | | |
| | | /** |
| | | * 解析处理器配置 |
| | | * @return |
| | | */ |
| | | protected TreeConfig parseConfig(ResourceLoader resourceLoader) { |
| | | try { |
| | | Resource resource = resourceLoader.getResource("classpath:RtuDataDealTree.xml"); |
| | | URL configFileURL = resource.getURL() ; |
| | | return this.parse(this.createDom(configFileURL)) ; |
| | | } catch (Exception e) { |
| | | System.out.println("系统启动时,初始上行数据处理任务配置出错 !"); |
| | | System.out.println(e.getMessage()); |
| | | e.printStackTrace(); |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * |