use of com.synopsys.integration.detectable.detectables.yarn.parse.entry.YarnLockEntryParseResult in project synopsys-detect by blackducksoftware.
the class YarnLockParser method parseYarnLock.
public YarnLock parseYarnLock(List<String> yarnLockFileAsList) {
List<YarnLockEntry> entries = new ArrayList<>();
int lineIndex = 0;
while (lineIndex < yarnLockFileAsList.size()) {
YarnLockEntryParseResult entryParseResult = yarnLockEntryParser.parseNextEntry(yarnLockFileAsList, lineIndex);
if (entryParseResult.getYarnLockEntry().isPresent()) {
YarnLockEntry entry = entryParseResult.getYarnLockEntry().get();
if (entry.isMetadataEntry()) {
yarnLockFileFormatVersion = entry.getVersion();
} else {
entries.add(entry);
}
}
lineIndex = entryParseResult.getLastParsedLineIndex();
lineIndex++;
}
return new YarnLock(yarnLockFileFormatVersion, isYarn1Project(yarnLockFileFormatVersion), entries);
}
Aggregations