use of com.synopsys.integration.detectable.detectables.sbt.parse.model.SbtModule in project synopsys-detect by blackducksoftware.
the class SbtReportParser method parseReportFromXml.
public SbtReport parseReportFromXml(Document xmlReport) {
Node ivyReport = XmlUtil.getNode(IVY_REPORT_NODE_KEY, xmlReport);
Node infoNode = XmlUtil.getNode(INFO_NODE_KEY, ivyReport);
Node dependenciesNode = XmlUtil.getNode(DEPENDENCIES_NODE_KEY, ivyReport);
List<Node> xmlModules = XmlUtil.getNodeList(MODULE_NODE_KEY, dependenciesNode);
String organisation = XmlUtil.getAttribute(ORGANISATION_NODE_KEY, infoNode);
String module = XmlUtil.getAttribute(MODULE_NODE_KEY, infoNode);
String revision = XmlUtil.getAttribute(REVISION_NODE_KEY, infoNode);
String configuration = XmlUtil.getAttribute(CONFIGURATION_NODE_KEY, infoNode);
List<SbtModule> dependencies = xmlModules.stream().map(this::createModule).collect(Collectors.toList());
return new SbtReport(organisation, module, revision, configuration, dependencies);
}