Package org.spdx.rdfparser.model
Class SpdxItem
java.lang.Object
org.spdx.rdfparser.model.RdfModelObject
org.spdx.rdfparser.model.SpdxElement
org.spdx.rdfparser.model.SpdxItem
- Direct Known Subclasses:
SpdxFile,SpdxPackage,SpdxSnippet
public class SpdxItem extends SpdxElement
An SpdxItem is a potentially copyrightable work.
- Author:
- Gary O'Neall
-
Field Summary
Fields inherited from class org.spdx.rdfparser.model.SpdxElement
annotations, comment, name, relationshipsFields inherited from class org.spdx.rdfparser.model.RdfModelObject
model, modelContainer, node, refreshOnGet, resource -
Constructor Summary
Constructors Constructor Description SpdxItem(String name, String comment, Annotation[] annotations, Relationship[] relationships, AnyLicenseInfo licenseConcluded, AnyLicenseInfo[] licenseInfoFromFiles, String copyrightText, String licenseComment)SpdxItem(String name, String comment, Annotation[] annotations, Relationship[] relationships, AnyLicenseInfo licenseConcluded, AnyLicenseInfo[] licenseInfoFromFiles, String copyrightText, String licenseComment, String[] attributionText)SpdxItem(IModelContainer modelContainer, org.apache.jena.graph.Node node)Create an SPDX item from a Jena model -
Method Summary
Modifier and Type Method Description SpdxItemclone()SpdxItemclone(Map<String,SpdxElement> clonedElementIds)Clones this element, but prevents infinite recursion by keeping track of all elements which have been clonedprotected AnyLicenseInfocloneLicenseConcluded()protected AnyLicenseInfo[]cloneLicenseInfosFromFiles()booleanequivalent(IRdfModel o)Returns true if the compare object contains properties which would be equal if they were contained in the same RDF Modelbooleanequivalent(IRdfModel o, boolean testRelationships)Test for equivalentString[]getAttributionText()StringgetCopyrightText()StringgetLicenseComment()Deprecated.StringgetLicenseComments()AnyLicenseInfogetLicenseConcluded()AnyLicenseInfo[]getLicenseInfoFromFiles()protected StringgetLicenseInfoFromFilesPropertyName()voidgetPropertiesFromModel()Fetch all of the properties from the model and populate the local Java propertiesorg.apache.jena.rdf.model.ResourcegetType(org.apache.jena.rdf.model.Model model)voidpopulateModel()Populate the RDF model from the Java propertiesvoidsetAttributionText(String[] attributionText)voidsetCopyrightText(String copyrightText)voidsetLicenseComment(String licenseComment)Deprecated.voidsetLicenseComments(String licenseComments)voidsetLicenseConcluded(AnyLicenseInfo licenseConcluded)voidsetLicenseInfosFromFiles(AnyLicenseInfo[] licenseInfoFromFiles)List<String>verify()Methods inherited from class org.spdx.rdfparser.model.SpdxElement
addAnnotation, addNameToWarnings, addRelationship, arraysEquivalent, arraysEquivalent, cloneAnnotations, cloneRelationships, equivalentConsideringNull, equivalentConsideringNull, getAnnotations, getComment, getId, getName, getNamePropertyName, getRelationships, getUri, setAnnotations, setComment, setId, setName, setRelationships, toStringMethods inherited from class org.spdx.rdfparser.model.RdfModelObject
addPropertyUriValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, createResource, createResource, equals, findAnnotationPropertyValues, findAnyLicenseInfoPropertyValue, findAnyLicenseInfoPropertyValues, findChecksumPropertyValue, findCreationInfoPropertyValue, findDuplicateResource, findElementPropertyValue, findExternalDocRefPropertyValues, findExternalDocRefPropertyValues, findExternalRefPropertyValues, findIntPropertyValue, findMultipleChecksumPropertyValues, findMultipleCrossRefPropertyValues, findMultipleDoapPropertyValues, findMultipleElementPropertyValues, findMultiplePropertyValues, findReferenceTypePropertyValue, findRelationshipPropertyValues, findReviewPropertyValues, findSinglePointerPropertyValue, findSinglePropertyValue, findStartEndPointerPropertyValues, findUriPropertyValue, findUriPropertyValues, findVerificationCodePropertyValue, getNode, hashCode, isRefreshOnGet, removePropertyValue, resourcesEqual, setMultipleObjectsForSameNode, setPropertyUriValue, setPropertyUriValues, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, SetPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setSingleObjectForSameNode
-
Constructor Details
-
SpdxItem
public SpdxItem(IModelContainer modelContainer, org.apache.jena.graph.Node node) throws InvalidSPDXAnalysisExceptionCreate an SPDX item from a Jena model- Parameters:
modelContainer- Container containing the modelnode-- Throws:
InvalidSPDXAnalysisException
-
SpdxItem
public SpdxItem(String name, String comment, Annotation[] annotations, Relationship[] relationships, AnyLicenseInfo licenseConcluded, AnyLicenseInfo[] licenseInfoFromFiles, String copyrightText, String licenseComment, String[] attributionText)- Parameters:
name- Name of the itemcomment- Optional comment about the itemannotations- Optional annotations on the itemsrelationships- Optional relationships with other SPDX elementslicenseConcluded- Concluded license for this itemlicenseInfoFromFiles- License infos from files for this itemcopyrightText- Copyright text for this itemlicenseComment- Optional comment on the licenseattributionText- Optional attribution text
-
SpdxItem
public SpdxItem(String name, String comment, Annotation[] annotations, Relationship[] relationships, AnyLicenseInfo licenseConcluded, AnyLicenseInfo[] licenseInfoFromFiles, String copyrightText, String licenseComment)- Parameters:
name- Name of the itemcomment- Optional comment about the itemannotations- Optional annotations on the itemsrelationships- Optional relationships with other SPDX elementslicenseConcluded- Concluded license for this itemlicenseInfoFromFiles- License infos from files for this itemcopyrightText- Copyright text for this itemlicenseComment- Optional comment on the license
-
-
Method Details
-
getPropertiesFromModel
Description copied from class:RdfModelObjectFetch all of the properties from the model and populate the local Java properties- Overrides:
getPropertiesFromModelin classSpdxElement- Throws:
InvalidSPDXAnalysisException
-
populateModel
Description copied from class:RdfModelObjectPopulate the RDF model from the Java properties- Overrides:
populateModelin classSpdxElement- Throws:
InvalidSPDXAnalysisException
-
getLicenseInfoFromFilesPropertyName
- Returns:
- Property name for licenseInfoFromFiles. Override if using a subproperty of "licenseDeclared".
-
getLicenseConcluded
- Returns:
- the licenseConcluded
-
setLicenseConcluded
public void setLicenseConcluded(AnyLicenseInfo licenseConcluded) throws InvalidSPDXAnalysisException- Parameters:
licenseConcluded- the licenseConcluded to set- Throws:
InvalidSPDXAnalysisException
-
getLicenseInfoFromFiles
- Returns:
- the licenseInfoFromFiles
-
setLicenseInfosFromFiles
public void setLicenseInfosFromFiles(AnyLicenseInfo[] licenseInfoFromFiles) throws InvalidSPDXAnalysisException- Parameters:
licenseInfoFromFiles- the licenseInfoFromFiles to set- Throws:
InvalidSPDXAnalysisException
-
getCopyrightText
- Returns:
- the copyrightText
-
setCopyrightText
- Parameters:
copyrightText- the copyrightText to set
-
setAttributionText
- Parameters:
attributionText- the attributionText to set
-
getAttributionText
- Returns:
- the Attribution Text
-
getLicenseComments
- Returns:
- the licenseComment
-
getLicenseComment
Deprecated.This has been replaced by getLicenseComments to match the latest SPDX 2.0 spec- Returns:
-
setLicenseComments
- Parameters:
licenseComments- the licenseComment to set
-
setLicenseComment
Deprecated.This has been replaced by setLicenseComments to match the latest SPDX 2.0 spec -
getType
public org.apache.jena.rdf.model.Resource getType(org.apache.jena.rdf.model.Model model)- Overrides:
getTypein classSpdxElement- Returns:
- the RDF class name for the object
-
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 classSpdxElement- Returns:
-
equivalent
Description copied from class:SpdxElementTest for equivalent- Overrides:
equivalentin classSpdxElementtestRelationships- If true, test relationships- Returns:
-
cloneLicenseConcluded
-
cloneLicenseInfosFromFiles
-
clone
- Overrides:
clonein classSpdxElement
-
clone
Description copied from class:SpdxElementClones this element, but prevents infinite recursion by keeping track of all elements which have been cloned- Overrides:
clonein classSpdxElement- Parameters:
clonedElementIds- element ID's fo all elements which have been cloned- Returns:
-
verify
- Specified by:
verifyin interfaceIRdfModel- Overrides:
verifyin classSpdxElement- Returns:
- List of validation errors for any non SPDX compliant properties.
-