Package org.spdx.library.model
Class SpdxItem
java.lang.Object
org.spdx.library.model.ModelObject
org.spdx.library.model.SpdxElement
org.spdx.library.model.SpdxItem
- Direct Known Subclasses:
GenericSpdxItem,SpdxFile,SpdxPackage,SpdxSnippet
public abstract class SpdxItem extends SpdxElement
An SpdxItem is a potentially copyrightable work.
- Author:
- Gary O'Neall
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SpdxItem()SpdxItem(String id)SpdxItem(IModelStore modelStore, String documentUri, String id, ModelCopyManager copyManager, boolean create) -
Method Summary
Modifier and Type Method Description protected List<String>_verify(Set<String> verifiedIds, String specVersion)Implementation of the specific verifications for this model objectCollection<String>getAttributionText()StringgetCopyrightText()Optional<String>getLicenseComments()AnyLicenseInfogetLicenseConcluded()Collection<AnyLicenseInfo>getLicenseInfoFromFiles()protected StringgetLicenseInfoFromFilesPropertyName()SpdxItemsetCopyrightText(String copyrightText)SpdxItemsetLicenseComments(String licenseComments)SpdxItemsetLicenseConcluded(AnyLicenseInfo license)Set the licenseConcludedSpdxItemsetName(String name)Set the nameMethods inherited from class org.spdx.library.model.SpdxElement
addAnnotation, addNameToWarnings, addRelationship, getAnnotations, getComment, getName, getNamePropertyName, getRelationships, removeAnnotation, removeRelationship, setAnnotations, setComment, setRelationshipsMethods inherited from class org.spdx.library.model.ModelObject
addPropertyValueToCollection, addValueToCollection, clearValueCollection, clearValueCollection, clone, copyFrom, createAnnotation, createByteOffsetPointer, createChecksum, createConjunctiveLicenseSet, createCreationInfo, createCrossRef, createDisjunctiveLicenseSet, createExternalDocumentRef, createExternalRef, createLineCharPointer, createPackage, createPackageVerificationCode, createRelationship, createSpdxFile, createSpdxSnippet, createStartEndPointer, enterCriticalSection, equals, equivalent, equivalent, getAnyLicenseInfoPropertyValue, getBooleanPropertyValue, getCopyManager, getDocumentUri, getElementPropertyValue, getEnumPropertyValue, getId, getIntegerPropertyValue, getModelStore, getObjectPropertyValue, getObjectPropertyValue, getObjectPropertyValueCollection, getObjectPropertyValueSet, getPropertyValueNames, getStringCollection, getStringPropertyValue, getType, hashCode, idToIdType, isCollectionMembersAssignableTo, isStrict, leaveCriticalSection, removeProperty, removeProperty, removePropertyValueFromCollection, removePropertyValueFromCollection, replacePropertyValueCollection, setCopyManager, setPropertyValue, setPropertyValue, setStrict, toString, toTypedValue, updateAddPropertyValueToCollection, updateClearValueCollection, updatePropertyValue, updateRemoveProperty, updateRemovePropertyValueFromCollection, verify, verify, verify, verifyCollection
-
Constructor Details
-
SpdxItem
- Throws:
InvalidSPDXAnalysisException
-
SpdxItem
- Parameters:
id-- Throws:
InvalidSPDXAnalysisException
-
SpdxItem
public SpdxItem(IModelStore modelStore, String documentUri, String id, @Nullable ModelCopyManager copyManager, boolean create) throws InvalidSPDXAnalysisException- Parameters:
modelStore-documentUri-id-copyManager-create-- Throws:
InvalidSPDXAnalysisException
-
-
Method Details
-
getLicenseInfoFromFilesPropertyName
- Returns:
- Property name for licenseInfoFromFiles. Override if using a subproperty of "licenseDeclared".
-
getLicenseConcluded
- Returns:
- the licenseConcluded
- Throws:
InvalidSPDXAnalysisException
-
setLicenseConcluded
public SpdxItem setLicenseConcluded(@Nullable AnyLicenseInfo license) throws InvalidSPDXAnalysisExceptionSet the licenseConcluded- Parameters:
license-- Returns:
- this so you can chain setters
- Throws:
InvalidSPDXAnalysisException
-
getLicenseInfoFromFiles
- Throws:
InvalidSPDXAnalysisException
-
getCopyrightText
- Returns:
- the copyrightText, empty string if no copyright was set
- Throws:
InvalidSPDXAnalysisException
-
setCopyrightText
public SpdxItem setCopyrightText(@Nullable String copyrightText) throws InvalidSPDXAnalysisException- Parameters:
copyrightText- the copyrightText to set- Returns:
- myself - so you can chain setters
- Throws:
InvalidSPDXAnalysisException
-
getAttributionText
- Returns:
- attribution text collection
- Throws:
InvalidSPDXAnalysisException
-
setName
Description copied from class:SpdxElementSet the name- Overrides:
setNamein classSpdxElement- Returns:
- this so that you can chain setters
- Throws:
InvalidSPDXAnalysisException
-
getLicenseComments
- Returns:
- the licenseComment
- Throws:
InvalidSPDXAnalysisException
-
setLicenseComments
- Parameters:
licenseComments- the licenseComment to set- Returns:
- this so you chan chain setters
- Throws:
InvalidSPDXAnalysisException
-
_verify
Description copied from class:ModelObjectImplementation of the specific verifications for this model object- Overrides:
_verifyin classSpdxElement- Parameters:
verifiedIds- list of all Element Id's which have already been verified - prevents infinite recursionspecVersion- Version of the SPDX spec to verify against- Returns:
- Any verification errors or warnings associated with this object
-