Package org.spdx.library.model
Class SpdxPackage
java.lang.Object
org.spdx.library.model.ModelObject
org.spdx.library.model.SpdxElement
org.spdx.library.model.SpdxItem
org.spdx.library.model.SpdxPackage
- All Implemented Interfaces:
Comparable<SpdxPackage>
public class SpdxPackage extends SpdxItem implements Comparable<SpdxPackage>
A Package represents a collection of software files that are
delivered as a single functional component.
- Author:
- Gary O'Neall
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSpdxPackage.SpdxPackageBuilder -
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description SpdxPackage()SpdxPackage(String id)protectedSpdxPackage(SpdxPackage.SpdxPackageBuilder spdxPackageBuilder)SpdxPackage(IModelStore modelStore, String documentUri, String id, ModelCopyManager copyManager, boolean create) -
Method Summary
Methods inherited from class org.spdx.library.model.SpdxItem
getAttributionText, getCopyrightText, getLicenseComments, getLicenseConcluded, getLicenseInfoFromFiles, getLicenseInfoFromFilesPropertyName, setCopyrightText, setLicenseComments, setLicenseConcluded, setNameMethods inherited from class org.spdx.library.model.SpdxElement
addAnnotation, addNameToWarnings, addRelationship, getAnnotations, getComment, getName, 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, 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
-
SpdxPackage
- Throws:
InvalidSPDXAnalysisException
-
SpdxPackage
public SpdxPackage(IModelStore modelStore, String documentUri, String id, @Nullable ModelCopyManager copyManager, boolean create) throws InvalidSPDXAnalysisException- Parameters:
modelStore-documentUri-id-copyManager-create-- Throws:
InvalidSPDXAnalysisException
-
SpdxPackage
- Parameters:
id-- Throws:
InvalidSPDXAnalysisException
-
SpdxPackage
protected SpdxPackage(SpdxPackage.SpdxPackageBuilder spdxPackageBuilder) throws InvalidSPDXAnalysisException- Throws:
InvalidSPDXAnalysisException
-
-
Method Details
-
getType
- Specified by:
getTypein classModelObject- Returns:
- The class name for this object. Class names are defined in the constants file
-
getNamePropertyName
- Overrides:
getNamePropertyNamein classSpdxElement- Returns:
- the property name used for the Name property. Override this function if using a subproperty of SPDX Name
-
isFilesAnalyzed
- Returns:
- true unless the filesAnalyzed property is present and set to false (default is true)
- Throws:
InvalidSPDXAnalysisException
-
setFilesAnalyzed
public SpdxPackage setFilesAnalyzed(@Nullable Boolean filesAnalyzed) throws InvalidSPDXAnalysisExceptionSet files Analyzed for the package- Parameters:
filesAnalyzed-- Returns:
- this to build additional options
- Throws:
InvalidSPDXAnalysisException
-
getBuiltDate
- Returns:
- This field provides a place for recording the actual date the package was built.
- Throws:
InvalidSPDXAnalysisException
-
setBuiltDate
- Parameters:
builtDate- This field provides a place for recording the actual date the package was built.- Throws:
InvalidSPDXAnalysisException
-
getReleaseDate
- Returns:
- This field provides a place for recording the date the package was released.
- Throws:
InvalidSPDXAnalysisException
-
setReleaseDate
- Parameters:
releaseDate- This field provides a place for recording the date the package was released.- Throws:
InvalidSPDXAnalysisException
-
getValidUntilDate
- Returns:
- This field provides a place for recording the end of the support period for a package from the supplier.
- Throws:
InvalidSPDXAnalysisException
-
setValidUntilDate
- Parameters:
validUntilDate- This field provides a place for recording the end of the support period for a package from the supplier.- Throws:
InvalidSPDXAnalysisException
-
getLicenseDeclared
- Returns:
- the licenseDeclared or NOASSERTION if no license declared is found
- Throws:
InvalidSPDXAnalysisException
-
setLicenseDeclared
public SpdxPackage setLicenseDeclared(@Nullable AnyLicenseInfo licenseDeclared) throws InvalidSPDXAnalysisExceptionSet the licenseDeclared- Parameters:
licenseDeclared-- Returns:
- this to build additional options
- Throws:
InvalidSPDXAnalysisException
-
getChecksums
- Returns:
- collection of checksums
- Throws:
InvalidSPDXAnalysisException
-
addChecksum
Add a checksum to the collection of checksums for this package- Parameters:
checksum-- Returns:
- this to build additional options
- Throws:
InvalidSPDXAnalysisException
-
getDescription
- Returns:
- the description
- Throws:
InvalidSPDXAnalysisException
-
setDescription
- Parameters:
description-- Returns:
- this to build additional options
- Throws:
InvalidSPDXAnalysisException
-
getDownloadLocation
- Returns:
- the downloadLocation
- Throws:
InvalidSPDXAnalysisException
-
setDownloadLocation
public SpdxPackage setDownloadLocation(String downloadLocation) throws InvalidSPDXAnalysisException- Parameters:
downloadLocation- the download location- Returns:
- this to build additional options
- Throws:
InvalidSPDXAnalysisException
-
getHomepage
- Returns:
- the homepage
- Throws:
InvalidSPDXAnalysisException
-
setHomepage
- Parameters:
homepage- the package homepage- Returns:
- this to build additional options
- Throws:
InvalidSPDXAnalysisException
-
getOriginator
- Returns:
- the originator
- Throws:
InvalidSPDXAnalysisException
-
setOriginator
- Parameters:
originator- the package originator- Returns:
- this to build additional options
- Throws:
InvalidSPDXAnalysisException
-
getPackageFileName
- Returns:
- the packageFileName
- Throws:
InvalidSPDXAnalysisException
-
setPackageFileName
- Parameters:
packageFileName- the package filename to set- Returns:
- this to build additional options
- Throws:
InvalidSPDXAnalysisException
-
getPackageVerificationCode
public Optional<SpdxPackageVerificationCode> getPackageVerificationCode() throws InvalidSPDXAnalysisException- Returns:
- the packageVerificationCode, null if not present
- Throws:
InvalidSPDXAnalysisException
-
setPackageVerificationCode
public SpdxPackage setPackageVerificationCode(SpdxPackageVerificationCode verificationCode) throws InvalidSPDXAnalysisException- Parameters:
verificationCode- the package verification code to set- Returns:
- this to build additional options
- Throws:
InvalidSPDXAnalysisException
-
getSourceInfo
- Returns:
- the sourceInfo
- Throws:
InvalidSPDXAnalysisException
-
setSourceInfo
- Parameters:
sourceInfo- package source info- Returns:
- this to build additional options
- Throws:
InvalidSPDXAnalysisException
-
getSummary
- Returns:
- the summary
- Throws:
InvalidSPDXAnalysisException
-
setSummary
- Parameters:
summary- package summary- Returns:
- this to build additional options
- Throws:
InvalidSPDXAnalysisException
-
getSupplier
- Returns:
- the supplier
- Throws:
InvalidSPDXAnalysisException
-
setSupplier
- Parameters:
supplier- the package supplier to set- Returns:
- this to build additional options
- Throws:
InvalidSPDXAnalysisException
-
getVersionInfo
- Returns:
- the versionInfo
- Throws:
InvalidSPDXAnalysisException
-
setVersionInfo
- Parameters:
versionInfo-- Returns:
- this to build additional options
- Throws:
InvalidSPDXAnalysisException
-
getExternalRefs
- Returns:
- the externalRefs
- Throws:
InvalidSPDXAnalysisException
-
addExternalRef
- Parameters:
externalRef-- Throws:
InvalidSPDXAnalysisException
-
getFiles
- Returns:
- the files
- Throws:
InvalidSPDXAnalysisException
-
addFile
Add a file to the collection of files attached to this package- Parameters:
file-- Returns:
- this to build additional options
- Throws:
InvalidSPDXAnalysisException
-
getPrimaryPurpose
- Returns:
- provides information about the primary purpose of the package. Package Purpose is intrinsic to how the package is being used rather than the content of the package.
- Throws:
InvalidSPDXAnalysisException
-
setPrimaryPurpose
- Parameters:
purpose- provides information about the primary purpose of the package. Package Purpose is intrinsic to how the package is being used rather than the content of the package.- Throws:
InvalidSPDXAnalysisException
-
_verify
Description copied from class:ModelObjectImplementation of the specific verifications for this model object -
compareTo
- Specified by:
compareToin interfaceComparable<SpdxPackage>
-
getSha1
- Returns:
- the Sha1 checksum value for this package, or a blank string if no sha1 checksum has been set
- Throws:
InvalidSPDXAnalysisException
-