Package org.spdx.library.model.v2
Class SpdxSnippet.SpdxSnippetBuilder
- java.lang.Object
-
- org.spdx.library.model.v2.SpdxSnippet.SpdxSnippetBuilder
-
- Enclosing class:
- SpdxSnippet
public static class SpdxSnippet.SpdxSnippetBuilder extends Object
-
-
Constructor Summary
Constructors Constructor Description SpdxSnippetBuilder(org.spdx.storage.IModelStore modelStore, String documentUri, String id, org.spdx.core.IModelCopyManager copyManager, String name, AnyLicenseInfo concludedLicense, Collection<AnyLicenseInfo> licenseInfosFromFile, String copyrightText, SpdxFile snippetFromFile, int startByte, int endByte)
Build a snippet with the required parameters
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SpdxSnippet.SpdxSnippetBuilder
addAnnotation(Annotation annotation)
SpdxSnippet.SpdxSnippetBuilder
addAttributionText(String attribution)
Add attribution to the attribution text collectionSpdxSnippet.SpdxSnippetBuilder
addRelationship(Relationship relationship)
SpdxSnippet
build()
SpdxSnippet.SpdxSnippetBuilder
setAnnotations(Collection<Annotation> annotations)
SpdxSnippet.SpdxSnippetBuilder
setAttributionText(Collection<String> attributionText)
Set the attribution testSpdxSnippet.SpdxSnippetBuilder
setComment(String comment)
SpdxSnippet.SpdxSnippetBuilder
setLicenseComments(String licenseComments)
SpdxSnippet.SpdxSnippetBuilder
setLineRange(int startLine, int endLine)
SpdxSnippet.SpdxSnippetBuilder
setRelationship(Collection<Relationship> relationships)
-
-
-
Constructor Detail
-
SpdxSnippetBuilder
public SpdxSnippetBuilder(org.spdx.storage.IModelStore modelStore, String documentUri, String id, @Nullable org.spdx.core.IModelCopyManager copyManager, String name, AnyLicenseInfo concludedLicense, Collection<AnyLicenseInfo> licenseInfosFromFile, String copyrightText, SpdxFile snippetFromFile, int startByte, int endByte)
Build a snippet with the required parameters- 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 documentcopyManager
- if non-null, allows for copying of any properties set which use other model stores or document URI'sname
- - File nameconcludedLicense
- license concludedlicenseInfosFromFile
- collection of seen licensescopyrightText
- Copyright textsnippetFromFile
- File where the snippet is locatedstartByte
- first byte of the snippet in the fileendByte
- end byte of the snippet in the file
-
-
Method Detail
-
setAnnotations
public SpdxSnippet.SpdxSnippetBuilder setAnnotations(Collection<Annotation> annotations)
- Parameters:
annotations
- Annotations- Returns:
- this to continue the build
-
addAnnotation
public SpdxSnippet.SpdxSnippetBuilder addAnnotation(Annotation annotation)
- Parameters:
annotation
- Annotation to add- Returns:
- this to continue the build
-
setRelationship
public SpdxSnippet.SpdxSnippetBuilder setRelationship(Collection<Relationship> relationships)
- Parameters:
relationships
- Relationships- Returns:
- this to continue the build
-
addRelationship
public SpdxSnippet.SpdxSnippetBuilder addRelationship(Relationship relationship)
- Parameters:
relationship
- Relationship to add- Returns:
- this to continue the build
-
setComment
public SpdxSnippet.SpdxSnippetBuilder setComment(@Nullable String comment)
- Parameters:
comment
- Comment- Returns:
- this to continue the build
-
setLicenseComments
public SpdxSnippet.SpdxSnippetBuilder setLicenseComments(@Nullable String licenseComments)
- Parameters:
licenseComments
-- Returns:
- this to continue the build
-
setAttributionText
public SpdxSnippet.SpdxSnippetBuilder setAttributionText(Collection<String> attributionText)
Set the attribution test- Parameters:
attributionText
- Attribution text for the file- Returns:
- this to continue the build
-
addAttributionText
public SpdxSnippet.SpdxSnippetBuilder addAttributionText(String attribution)
Add attribution to the attribution text collection- Parameters:
attribution
-- Returns:
- this to continue the build
-
setLineRange
public SpdxSnippet.SpdxSnippetBuilder setLineRange(int startLine, int endLine)
- Parameters:
startLine
- first line of the snippetendLine
- end line of the snippet- Returns:
- this to continue the build
-
build
public SpdxSnippet build() throws org.spdx.core.InvalidSPDXAnalysisException
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
-