Package org.spdx.tag
Class BuildDocument
java.lang.Object
org.spdx.tag.BuildDocument
- All Implemented Interfaces:
TagValueBehavior
Translates an tag-value file to a an SPDX Document.
Supports SPDX version 2.3
2.0, 2.1, 2.2 and 2.3 changes made by Gary O'Neall
- Author:
- Rana Rahal, Protecode Inc.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionBuildDocument
(org.spdx.storage.IModelStore modelStore, Properties constants, List<String> warnings) -
Method Summary
Modifier and TypeMethodDescriptionvoid
buildDocument
(String tag, String value, int lineNumber) void
enter()
void
exit()
static org.spdx.library.model.v2.Checksum
parseChecksum
(String value, int lineNumber, org.spdx.library.model.v2.SpdxDocument document) Creates a Checksum from the parameters specified in the tag valuestatic org.spdx.library.model.v2.ExternalDocumentRef
parseExternalDocumentRef
(String refStr, int lineNumber, org.spdx.library.model.v2.SpdxDocument document) Parse a tag/value external document reference string
-
Field Details
-
CHECKSUM_PATTERN
-
-
Constructor Details
-
BuildDocument
public BuildDocument(org.spdx.storage.IModelStore modelStore, Properties constants, List<String> warnings)
-
-
Method Details
-
enter
- Specified by:
enter
in interfaceTagValueBehavior
- Throws:
Exception
-
buildDocument
- Specified by:
buildDocument
in interfaceTagValueBehavior
- Throws:
Exception
-
parseExternalDocumentRef
public static org.spdx.library.model.v2.ExternalDocumentRef parseExternalDocumentRef(String refStr, int lineNumber, org.spdx.library.model.v2.SpdxDocument document) throws org.spdx.core.InvalidSPDXAnalysisException Parse a tag/value external document reference string- Parameters:
refStr
- String containing a tag/value representation of the external document reflineNumber
-document
- SPDX document where the external document reference will be store- Returns:
- ExternalDocumentRef represented by the pattern
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
parseChecksum
public static org.spdx.library.model.v2.Checksum parseChecksum(String value, int lineNumber, org.spdx.library.model.v2.SpdxDocument document) throws org.spdx.core.InvalidSPDXAnalysisException Creates a Checksum from the parameters specified in the tag value- Parameters:
value
- checksum value in tag/value formatlineNumber
-document
- SPDX document containing the checksum- Returns:
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
exit
- Specified by:
exit
in interfaceTagValueBehavior
- Throws:
Exception
-
getDocumentUri
-