public class LicenseInfoFactory extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
NOASSERTION_LICENSE_NAME |
static String |
NONE_LICENSE_NAME |
| Constructor and Description |
|---|
LicenseInfoFactory() |
| Modifier and Type | Method and Description |
|---|---|
static AnyLicenseInfo |
getLicenseInfoFromModel(IModelContainer modelContainer,
org.apache.jena.graph.Node node)
Create the appropriate SPDXLicenseInfo from the model and node provided.
|
static String |
getLicenseListVersion() |
static SpdxListedLicense |
getListedLicenseById(String licenseId) |
static String[] |
getSpdxListedLicenseIds() |
static boolean |
isSpdxListedLicenseID(String licenseID) |
static AnyLicenseInfo |
parseSPDXLicenseString(String licenseString)
Parses a license string and converts it into a SPDXLicenseInfo object
Syntax - A license set must start and end with a parenthesis "("
A conjunctive license set will have and AND after the first
licenseInfo term
A disjunctive license set will have an OR after the first
licenseInfo term
If there is no And or Or, then it is converted to a simple
license type
A space or tab must be used between license ID's and the
keywords AND and OR
A licenseID must NOT be "AND" or "OR"
|
static AnyLicenseInfo |
parseSPDXLicenseString(String licenseString,
SpdxDocumentContainer container)
Parses a license string and converts it into a SPDXLicenseInfo object
Syntax - A license set must start and end with a parenthesis "("
A conjunctive license set will have and AND after the first
licenseInfo term
A disjunctive license set will have an OR after the first
licenseInfo term
If there is no And or Or, then it is converted to a simple
license type
A space or tab must be used between license ID's and the
keywords AND and OR
A licenseID must NOT be "AND" or "OR"
|
public static final String NOASSERTION_LICENSE_NAME
public static final String NONE_LICENSE_NAME
public static AnyLicenseInfo getLicenseInfoFromModel(IModelContainer modelContainer, org.apache.jena.graph.Node node) throws InvalidSPDXAnalysisException
modelContainer - node - InvalidSPDXAnalysisExceptionpublic static SpdxListedLicense getListedLicenseById(String licenseId) throws InvalidSPDXAnalysisException
licenseId - SPDX Listed License IDInvalidSPDXAnalysisExceptionpublic static AnyLicenseInfo parseSPDXLicenseString(String licenseString, SpdxDocumentContainer container) throws InvalidLicenseStringException
licenseString - String conforming to the syntaxcontainer - Container containing any extractedLicenseInfos - if any extractedLicenseInfos by ID already exist, they will be used. If
none exist for an ID, they will be added. If null, a simple Java object will be created for the extractedLicenseInfo.InvalidLicenseStringExceptionpublic static AnyLicenseInfo parseSPDXLicenseString(String licenseString) throws InvalidLicenseStringException
licenseString - String conforming to the syntaxInvalidLicenseStringExceptionpublic static boolean isSpdxListedLicenseID(String licenseID)
licenseID - InvalidSPDXAnalysisExceptionpublic static String[] getSpdxListedLicenseIds()
public static String getLicenseListVersion()
Copyright © 2017 Linux Foundation. All Rights Reserved.