Package org.spdx.tag

Class BuildDocument

java.lang.Object
org.spdx.tag.BuildDocument
All Implemented Interfaces:
TagValueBehavior

public class BuildDocument extends Object implements 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 Details

    • CHECKSUM_PATTERN

      public static Pattern CHECKSUM_PATTERN
  • Constructor Details

    • BuildDocument

      public BuildDocument(org.spdx.storage.IModelStore modelStore, Properties constants, List<String> warnings)
  • Method Details

    • enter

      public void enter() throws Exception
      Specified by:
      enter in interface TagValueBehavior
      Throws:
      Exception
    • buildDocument

      public void buildDocument(String tag, String value, int lineNumber) throws Exception
      Specified by:
      buildDocument in interface TagValueBehavior
      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 ref
      lineNumber -
      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 format
      lineNumber -
      document - SPDX document containing the checksum
      Returns:
      Throws:
      org.spdx.core.InvalidSPDXAnalysisException
    • exit

      public void exit() throws Exception
      Specified by:
      exit in interface TagValueBehavior
      Throws:
      Exception
    • getDocumentUri

      public String getDocumentUri()