public class LicenseCompareHelper extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static HashMap<String,String> |
EQUIV_TOKENS |
protected static HashSet<String> |
SKIPPABLE_TOKENS |
protected static String |
TOKEN_DELIM |
| Constructor and Description |
|---|
LicenseCompareHelper() |
| Modifier and Type | Method and Description |
|---|---|
static boolean |
isLicenseEqual(SPDXLicenseInfo license1,
SPDXLicenseInfo license2,
HashMap<String,String> xlationMap)
Compares two licenses from potentially two different documents which may have
different license ID's for the same license
|
static boolean |
isLicenseTextEquivalent(String licenseTextA,
String licenseTextB)
Returns true if two sets of license text is considered a match per
the SPDX License matching guidelines documented at spdx.org (currently http://spdx.org/wiki/spdx-license-list-match-guidelines)
There are 2 unimplemented features - bullets/numbering is not considered and comments with no whitespace between text is not skipped
|
static boolean |
isTextStandardLicense(SPDXStandardLicense license,
String compareText) |
protected static final String TOKEN_DELIM
public static boolean isLicenseTextEquivalent(String licenseTextA, String licenseTextB)
licenseTextA - licenseTextB - public static boolean isLicenseEqual(SPDXLicenseInfo license1, SPDXLicenseInfo license2, HashMap<String,String> xlationMap) throws SpdxCompareException
license1 - license2 - xlationMap - Mapping the license ID's from license 1 to license 2SpdxCompareExceptionpublic static boolean isTextStandardLicense(SPDXStandardLicense license, String compareText) throws SpdxCompareException
SpdxCompareExceptionCopyright © 2014 Linux Foundation. All Rights Reserved.