Package org.spdx.rdfparser.license
Class License
java.lang.Object
org.spdx.rdfparser.model.RdfModelObject
org.spdx.rdfparser.license.AnyLicenseInfo
org.spdx.rdfparser.license.SimpleLicensingInfo
org.spdx.rdfparser.license.License
- Direct Known Subclasses:
SpdxListedLicense
public abstract class License extends SimpleLicensingInfo
Describes a license
All licenses have an ID.
Subclasses should extend this class to add additional properties.
- Author:
- Gary O'Neall
-
Field Summary
Fields Modifier and Type Field Description protected booleandeprecatedprotected BooleanfsfLibreprotected StringlicenseTextprotected booleanosiApprovedprotected StringstandardLicenseHeaderprotected StringstandardLicenseTemplateFields inherited from class org.spdx.rdfparser.license.SimpleLicensingInfo
comment, crossRef, licenseId, name, seeAlsoFields inherited from class org.spdx.rdfparser.model.RdfModelObject
model, modelContainer, node, refreshOnGet, resource -
Constructor Summary
Constructors Constructor Description License(String name, String id, String text, String[] sourceUrl, String[] sourceUrlDetails, String comments, String standardLicenseHeader, String template, String standardLicenseHeaderTemplate, boolean osiApproved, Boolean fsfLibre)License(String name, String id, String text, String[] sourceUrl, String comments, String standardLicenseHeader, String template, boolean osiApproved)License(String name, String id, String text, String[] sourceUrl, String comments, String standardLicenseHeader, String template, boolean osiApproved, Boolean fsfLibre)License(String name, String id, String text, String[] sourceUrl, String comments, String standardLicenseHeader, String template, String standardLicenseHeaderTemplate, boolean osiApproved, Boolean fsfLibre)License(IModelContainer modelContainer, org.apache.jena.graph.Node licenseNode)Constructs an SPDX License from the licenseNode -
Method Summary
Modifier and Type Method Description AnyLicenseInfoclone()voidcopyFrom(License license)Copy all of the parameters from another licensebooleanequals(Object o)booleanequivalent(IRdfModel compare)Returns true if the compare object contains properties which would be equal if they were contained in the same RDF ModelBooleangetFsfLibre()StringgetLicenseText()StringgetNotes()Deprecated.voidgetPropertiesFromModel()Fetch all of the properties from the model and populate the local Java propertiesStringgetStandardLicenseHeader()StringgetStandardLicenseHeaderTemplate()StringgetStandardLicenseTemplate()inthashCode()booleanisDeprecated()booleanisFsfLibre()booleanisNotFsfLibre()booleanisOsiApproved()voidpopulateModel()Populate the RDF model from the Java propertiesvoidsetDeprecated(boolean deprecated)voidsetFsfLibre(Boolean fsfLibre)voidsetLicenseText(String text)voidsetNotes(String notes)Deprecated.voidsetOsiApproved(boolean osiApproved)voidsetStandardLicenseHeader(String standardLicenseHeader)voidsetStandardLicenseHeaderTemplate(String standardLicenseHeaderTemplate)voidsetStandardLicenseTemplate(String template)StringtoString()List<String>verify()Methods inherited from class org.spdx.rdfparser.license.SimpleLicensingInfo
findDuplicateResource, getComment, getCrossRef, getLicenseId, getName, getSeeAlso, getUri, setComment, setCrossRef, setLicenseId, setName, setSeeAlsoMethods inherited from class org.spdx.rdfparser.model.RdfModelObject
addPropertyUriValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, arraysEquivalent, createResource, createResource, equivalentConsideringNull, findAnnotationPropertyValues, findAnyLicenseInfoPropertyValue, findAnyLicenseInfoPropertyValues, findChecksumPropertyValue, findCreationInfoPropertyValue, findElementPropertyValue, findExternalDocRefPropertyValues, findExternalDocRefPropertyValues, findExternalRefPropertyValues, findIntPropertyValue, findMultipleChecksumPropertyValues, findMultipleDoapPropertyValues, findMultipleElementPropertyValues, findMultiplePropertyValues, findReferenceTypePropertyValue, findRelationshipPropertyValues, findReviewPropertyValues, findSinglePointerPropertyValue, findSinglePropertyValue, findStartEndPointerPropertyValues, findUriPropertyValue, findUriPropertyValues, findVerificationCodePropertyValue, getNode, getType, isRefreshOnGet, removePropertyValue, resourcesEqual, setMultipleObjectsForSameNode, setPropertyUriValue, setPropertyUriValues, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setSingleObjectForSameNode
-
Field Details
-
standardLicenseHeader
-
standardLicenseTemplate
-
licenseText
-
osiApproved
protected boolean osiApproved -
fsfLibre
-
deprecated
protected boolean deprecated
-
-
Constructor Details
-
License
public License(String name, String id, String text, String[] sourceUrl, String comments, String standardLicenseHeader, String template, boolean osiApproved) throws InvalidSPDXAnalysisException- Parameters:
name- License nameid- License IDtext- License textsourceUrl- Optional URLs that reference this licensecomments- Optional commentsstandardLicenseHeader- Optional license headertemplate- Optional templateosiApproved- True if this is an OSI Approvied license- Throws:
InvalidSPDXAnalysisException
-
License
public License(String name, String id, String text, String[] sourceUrl, String comments, String standardLicenseHeader, String template, String standardLicenseHeaderTemplate, boolean osiApproved, Boolean fsfLibre) throws InvalidSPDXAnalysisException- Parameters:
name- License nameid- License IDtext- License textsourceUrl- Optional URLs that reference this licensecomments- Optional commentsstandardLicenseHeader- Optional license headertemplate- Optional templatestandardLicenseHeaderTemplate- optional template for the standard license headerosiApproved- True if this is an OSI Approvied licensefsfLibre- true if FSF describes the license as free / libre, false if FSF describes the license as not free / libre, null if FSF does not reference the license- Throws:
InvalidSPDXAnalysisException
-
License
public License(String name, String id, String text, String[] sourceUrl, String[] sourceUrlDetails, String comments, String standardLicenseHeader, String template, String standardLicenseHeaderTemplate, boolean osiApproved, Boolean fsfLibre) throws InvalidSPDXAnalysisException- Parameters:
name- License nameid- License IDtext- License textsourceUrl- Optional URLs that reference this licensecomments- Optional commentsstandardLicenseHeader- Optional license headertemplate- Optional templatestandardLicenseHeaderTemplate- optional template for the standard license headerosiApproved- True if this is an OSI Approvied licensefsfLibre- true if FSF describes the license as free / libre, false if FSF describes the license as not free / libre, null if FSF does not reference the license- Throws:
InvalidSPDXAnalysisException
-
License
public License(String name, String id, String text, String[] sourceUrl, String comments, String standardLicenseHeader, String template, boolean osiApproved, Boolean fsfLibre) throws InvalidSPDXAnalysisException- Parameters:
name- License nameid- License IDtext- License textsourceUrl- Optional URLs that reference this licensecomments- Optional commentsstandardLicenseHeader- Optional license headertemplate- Optional templateosiApproved- True if this is an OSI Approvied licensefsfLibre- True if the license is listed by the Free Software Foundation as free / libre- Throws:
InvalidSPDXAnalysisException
-
License
public License(IModelContainer modelContainer, org.apache.jena.graph.Node licenseNode) throws InvalidSPDXAnalysisExceptionConstructs an SPDX License from the licenseNode- Parameters:
modelContainer- container which includes the licenselicenseNode- RDF graph node representing the SPDX License- Throws:
InvalidSPDXAnalysisException
-
-
Method Details
-
getPropertiesFromModel
Description copied from class:RdfModelObjectFetch all of the properties from the model and populate the local Java properties- Overrides:
getPropertiesFromModelin classSimpleLicensingInfo- Throws:
InvalidSPDXAnalysisException
-
populateModel
Description copied from class:RdfModelObjectPopulate the RDF model from the Java properties- Overrides:
populateModelin classSimpleLicensingInfo- Throws:
InvalidSPDXAnalysisException
-
getLicenseText
- Returns:
- the text of the license
-
setLicenseText
- Parameters:
text- the license text to set
-
getNotes
Deprecated. -
setNotes
Deprecated. -
getStandardLicenseHeader
- Returns:
- the standardLicenseHeader
-
getStandardLicenseHeaderTemplate
- Returns:
- standard license header template
-
setStandardLicenseHeaderTemplate
- Parameters:
standardLicenseHeaderTemplate-
-
setStandardLicenseHeader
- Parameters:
standardLicenseHeader- the standardLicenseHeader to set
-
getStandardLicenseTemplate
- Returns:
- the template
-
setStandardLicenseTemplate
- Parameters:
template- the template to set
-
toString
- Specified by:
toStringin classAnyLicenseInfo
-
hashCode
public int hashCode()- Overrides:
hashCodein classSimpleLicensingInfo
-
equals
- Overrides:
equalsin classSimpleLicensingInfo
-
verify
- Returns:
- List of validation errors for any non SPDX compliant properties.
-
isFsfLibre
public boolean isFsfLibre()- Returns:
- true if FSF describes the license as free / libre, false if FSF describes the license as not free / libre or if FSF does not reference the license
- Throws:
InvalidSPDXAnalysisException
-
isNotFsfLibre
public boolean isNotFsfLibre()- Returns:
- true if FSF specified this license as not free/libre, false if it has been specified by the FSF as free / libre or if it has not been specified
-
getFsfLibre
- Returns:
- true if FSF describes the license as free / libre, false if FSF describes the license as not free / libre, null if FSF does not reference the license
-
isOsiApproved
public boolean isOsiApproved()- Returns:
- true if the license is listed as an approved license on the OSI website
-
isDeprecated
public boolean isDeprecated()- Returns:
- true if this license is marked as being deprecated
-
setOsiApproved
public void setOsiApproved(boolean osiApproved) -
setFsfLibre
- Parameters:
fsfLibre- true if FSF describes the license as free / libre, false if FSF describes the license as not free / libre, null if FSF does not reference the license
-
setDeprecated
public void setDeprecated(boolean deprecated)- Parameters:
deprecated- true if this license is deprecated
-
clone
- Specified by:
clonein classAnyLicenseInfo
-
copyFrom
Copy all of the parameters from another license- Parameters:
license-
-
equivalent
Description copied from interface:IRdfModelReturns true if the compare object contains properties which would be equal if they were contained in the same RDF Model- Specified by:
equivalentin interfaceIRdfModel- Overrides:
equivalentin classSimpleLicensingInfo- Parameters:
compare-- Returns:
-