Package org.spdx.library.model
Class SpdxSnippet.SpdxSnippetBuilder
java.lang.Object
org.spdx.library.model.SpdxSnippet.SpdxSnippetBuilder
- Enclosing class:
- SpdxSnippet
public static class SpdxSnippet.SpdxSnippetBuilder extends Object
-
Constructor Summary
Constructors Constructor Description SpdxSnippetBuilder(IModelStore modelStore, String documentUri, String id, ModelCopyManager 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
Modifier and Type Method Description SpdxSnippet.SpdxSnippetBuilder
addAnnotation(Annotation annotation)
SpdxSnippet.SpdxSnippetBuilder
addRelationship(Relationship relationship)
SpdxSnippet
build()
SpdxSnippet.SpdxSnippetBuilder
setAnnotations(Collection<Annotation> annotations)
SpdxSnippet.SpdxSnippetBuilder
setComment(String comment)
SpdxSnippet.SpdxSnippetBuilder
setLicenseComments(String licenseComments)
SpdxSnippet.SpdxSnippetBuilder
setLineRange(int startLine, int endLine)
SpdxSnippet.SpdxSnippetBuilder
setRelationship(Collection<Relationship> relationships)
-
Constructor Details
-
SpdxSnippetBuilder
public SpdxSnippetBuilder(IModelStore modelStore, String documentUri, String id, @Nullable ModelCopyManager 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 Details
-
setAnnotations
- Parameters:
annotations
- Annotations- Returns:
- this to continue the build
-
addAnnotation
- Parameters:
annotation
- Annotation to add- Returns:
- this to continue the build
-
setRelationship
- 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
-
setLicenseComments
- Parameters:
licenseComments
-- Returns:
- this to continue the build
-
setLineRange
- Parameters:
startLine
- first line of the snippetendLine
- end line of the snippet- Returns:
- this to continue the build
-
build
- Throws:
InvalidSPDXAnalysisException
-