public class SpdxSnippetComparer extends SpdxItemComparer
compare(snippetA, snippetB) method will perform the comparison and
store the results. isDifferenceFound() will return true of any
differences were found.documentItem, extractedLicenseIdMap, name| Constructor and Description |
|---|
SpdxSnippetComparer(Map<SpdxDocument,Map<SpdxDocument,Map<String,String>>> extractedLicenseIdMap) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDocumentSnippet(SpdxDocument spdxDocument,
SpdxSnippet snippet)
Add a snippet to the comparer and performs the comparison to any existing documents
|
protected void |
checkInProgress()
checks to make sure there is not a compare in progress
|
SpdxSnippet |
getDocSnippet(SpdxDocument spdxDocument) |
int |
getNumSnippets() |
SpdxFileDifference |
getSnippetFromFileDifference(SpdxDocument docA,
SpdxDocument docB)
Get any file difference for the Spdx Snippet From File between the two SPDX documents
If the fileName is different, the they are considered unique files and the getUniqueSnippetFromFile should be called
to obtain the unique file
|
SpdxFile |
getUniqueSnippetFromFile(SpdxDocument docA,
SpdxDocument docB)
Get an SpdxFile that only exists in docA but not docB
|
boolean |
isByteRangeEquals() |
boolean |
isDifferenceFound() |
boolean |
isLineRangeEquals() |
boolean |
isNameEquals() |
boolean |
isSnippetFromFilesEquals()
The snippetFromFiles can be true if there are some unique snippetFromFiles or differences between the snippetFromFiles (or both)
|
addDocumentItem, getItem, getUniqueAnnotations, getUniqueRelationship, getUniqueSeenLicenses, isAnnotationsEquals, isCommentsEquals, isConcludedLicenseEquals, isCopyrightsEquals, isInProgress, isLicenseCommmentsEquals, isRelationshipsEquals, isSeenLicenseEqualspublic SpdxSnippetComparer(Map<SpdxDocument,Map<SpdxDocument,Map<String,String>>> extractedLicenseIdMap)
extractedLicenseIdMap - map of all extracted license IDs for any SPDX documents to be added to the comparerpublic void addDocumentSnippet(SpdxDocument spdxDocument, SpdxSnippet snippet) throws SpdxCompareException
spdxDocument - document containing the packagesnippet - snippet to be addedlicenseXlationMap - A mapping between the license IDs from licenses in fileA to fileBspdxDocument - snippet - SpdxCompareExceptionpublic boolean isDifferenceFound()
throws SpdxCompareException
isDifferenceFound in class SpdxItemComparerSpdxCompareExceptionprotected void checkInProgress()
throws SpdxCompareException
checkInProgress in class SpdxItemComparerSpdxCompareExceptionpublic SpdxFileDifference getSnippetFromFileDifference(SpdxDocument docA, SpdxDocument docB) throws SpdxCompareException
docA - docB - SpdxCompareExceptionpublic boolean isByteRangeEquals()
throws SpdxCompareException
SpdxCompareExceptionpublic boolean isLineRangeEquals()
throws SpdxCompareException
SpdxCompareExceptionpublic boolean isSnippetFromFilesEquals()
throws SpdxCompareException
SpdxCompareExceptionpublic boolean isNameEquals()
throws SpdxCompareException
SpdxCompareExceptionpublic SpdxFile getUniqueSnippetFromFile(SpdxDocument docA, SpdxDocument docB) throws SpdxCompareException
docA - docB - SpdxCompareExceptionpublic int getNumSnippets()
public SpdxSnippet getDocSnippet(SpdxDocument spdxDocument)
spdxDocument - Copyright © 2017 Linux Foundation. All Rights Reserved.