Package org.spdx.library.model
Class SpdxPackage.SpdxPackageBuilder
java.lang.Object
org.spdx.library.model.SpdxPackage.SpdxPackageBuilder
- Enclosing class:
- SpdxPackage
public static class SpdxPackage.SpdxPackageBuilder extends Object
-
Constructor Summary
Constructors Constructor Description SpdxPackageBuilder(IModelStore modelStore, String documentUri, String id, ModelCopyManager copyManager, String name, AnyLicenseInfo concludedLicense, String copyrightText, AnyLicenseInfo licenseDeclared)Build an SpdxPackage with the required parameters if isFilesAnalyzed is false - note isFilesAnalyzed must be explicitly set to false -
Method Summary
-
Constructor Details
-
SpdxPackageBuilder
public SpdxPackageBuilder(IModelStore modelStore, String documentUri, String id, @Nullable ModelCopyManager copyManager, String name, AnyLicenseInfo concludedLicense, String copyrightText, AnyLicenseInfo licenseDeclared)Build an SpdxPackage with the required parameters if isFilesAnalyzed is false - note isFilesAnalyzed must be explicitly set to false- Parameters:
modelStore- Storage for the model objectsdocumentUri- SPDX Document URI for a document associated with this modelid- ID for this object - must be unique within the SPDX documentname- File namecopyManager-concludedLicense-copyrightText- Copyright textlicenseDeclared- Declared license for the package
-
-
Method Details
-
setAnnotations
- Parameters:
annotations- Annotations- Returns:
- this to continue the build
-
addAnnotation
- Parameters:
annotation- Annotation to add- Returns:
- this to continue the build
-
setRelationships
- Parameters:
relationships- Relationships- Returns:
- this to continue the build
-
addRelationship
- Parameters:
relationship- Relationship to add- Returns:
- this to continue the build
-
setComment
- Parameters:
comment- Comment- Returns:
- this to continue the build
-
setLicenseInfosFromFile
public SpdxPackage.SpdxPackageBuilder setLicenseInfosFromFile(Collection<AnyLicenseInfo> licenseInfosFromFile)- Parameters:
licenseInfosFromFile- License information from all files in the package- Returns:
- this to continue the build
-
addLicenseInfosFromFile
- Parameters:
licenseInfo- license info for a file to be added to the collection of license infos- Returns:
- this to continue the build
-
setLicenseComments
- Parameters:
licenseComments- license comments- Returns:
- this to continue the build
-
setChecksums
- Parameters:
checksums- Checksum- Returns:
- this to continue the build
-
addChecksum
- Parameters:
checksum- Checksum to add- Returns:
- this to continue the build
-
setDescription
- Parameters:
description- long description- Returns:
- this to continue the build
-
setExternalRefs
- Parameters:
externalRefs- external references to this package- Returns:
- this to continue the build
-
addExternalRef
- Parameters:
externalRef- external reference to this package- Returns:
- this to continue the build
-
setFiles
- Parameters:
files- files contained in the package- Returns:
- this to continue the build
-
addFile
- Parameters:
file- file to be added to the collection of files- Returns:
- this to continue the build
-
setHomepage
- Parameters:
homepage- package home page- Returns:
- this to continue the build
-
setOriginator
- Parameters:
originator- originator of the package- Returns:
- this to continue the build
-
setPackageFileName
- Parameters:
packageFileName- file name of the archive containing the package- Returns:
- this to continue the build
-
setPackageVerificationCode
public SpdxPackage.SpdxPackageBuilder setPackageVerificationCode(SpdxPackageVerificationCode packageVerificationCode)- Parameters:
packageVerificationCode- Package verification code calculated from the files- Returns:
- this to continue the build
-
setSourceInfo
- Parameters:
sourceInfo- Information on the source of the package- Returns:
- this to continue the build
-
setSummary
- Parameters:
summary- Short description- Returns:
- this to continue the build
-
setSupplier
- Parameters:
supplier- Package supplier- Returns:
- this to continue the build
-
setVersionInfo
- Parameters:
versionInfo- Package version- Returns:
- this to continue the build
-
setFilesAnalyzed
- Parameters:
filesAnalyzed- if true, files were analyzed for this package - add additional required parameters files, verificationCode and licenseInfosFromFile- Returns:
- this to continue the build
-
setDownloadLocation
- Parameters:
downloadLocation- download location for the package- Returns:
- this to continue the build
-
setAttributionText
- Parameters:
attributionText- Attribution text for the package- Returns:
- this to continue the build
-
addAttributionText
- Parameters:
attribution- attribution to add to the attribution text- Returns:
- this to continue the build
-
setPrimaryPurpose
- Parameters:
purpose- Package Purpose is intrinsic to how the package is being used rather than the content of the package.- Returns:
- this to continue the build
-
setBuiltDate
- Parameters:
builtDate- This field provides a place for recording the actual date the package was built.- Returns:
- this to continue the build
-
setValidUntilDate
- Parameters:
validUntilDate- This field provides a place for recording the end of the support period for a package from the supplier.- Returns:
- this to continue the build
-
setReleaseDate
- Parameters:
releaseDate- This field provides a place for recording the date the package was released.- Returns:
- this to continue the build
-
build
- Returns:
- the SPDX package
- Throws:
InvalidSPDXAnalysisException
-