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.SpdxSnippetBuilderaddAnnotation(Annotation annotation)SpdxSnippet.SpdxSnippetBuilderaddAttributionText(String attribution)Add attribution to the attribution text collectionSpdxSnippet.SpdxSnippetBuilderaddRelationship(Relationship relationship)SpdxSnippetbuild()SpdxSnippet.SpdxSnippetBuildersetAnnotations(Collection<Annotation> annotations)SpdxSnippet.SpdxSnippetBuildersetAttributionText(Collection<String> attributionText)Set the attribution testSpdxSnippet.SpdxSnippetBuildersetComment(String comment)SpdxSnippet.SpdxSnippetBuildersetLicenseComments(String licenseComments)SpdxSnippet.SpdxSnippetBuildersetLineRange(int startLine, int endLine)SpdxSnippet.SpdxSnippetBuildersetRelationship(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
-
setAttributionText
Set the attribution test- Parameters:
attributionText- Attribution text for the file- Returns:
- this to continue the build
-
addAttributionText
Add attribution to the attribution text collection- Parameters:
attribution-- 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
-