Class ModelObject

java.lang.Object
org.spdx.library.model.ModelObject
Direct Known Subclasses:
Annotation, AnyLicenseInfo, Checksum, CompoundPointer, CrossRef, ExternalDocumentRef, ExternalRef, GenericModelObject, LicenseException, Relationship, SinglePointer, SpdxCreatorInformation, SpdxElement, SpdxPackageVerificationCode

public abstract class ModelObject extends Object
Author:
Gary O'Neall Superclass for all SPDX model objects Provides the primary interface to the storage class that access and stores the data for the model objects. This class includes several helper methods to manage the storage and retrieval of properties. Each model object is in itself stateless. All state is maintained in the Model Store. The Document URI uniquely identifies the document containing the model object. The concrete classes are expected to implements getters for the model class properties which translate into calls to the getTYPEPropertyValue where TYPE is the type of value to be returned and the property name is passed as a parameter. There are 2 methods of setting values: - call the setPropertyValue, clearValueCollection or addValueToCollection methods - this will call the modelStore and store the value immediately - Gather a list of updates by calling the updatePropertyValue, updateClearValueList, or updateAddPropertyValue methods. These methods return a ModelUpdate which can be applied later by calling the apply() method. A convenience method Write.applyUpdatesInOneTransaction will perform all updates within a single transaction. This method may result in higher performance updates for some Model Store implementations. Note that none of the updates will be applied until the storage manager update method is invoked. Property values are restricted to the following types: - String - Java Strings - Booolean - Java Boolean or primitive boolean types - ModelObject - A concrete subclass of this type - Collection<T> - A Collection of type T where T is one of the supported non-collection types This class also handles the conversion of a ModelObject to and from a TypeValue for storage in the ModelStore.
  • Field Details

    • strict

      protected boolean strict
      if true, checks input values for setters to verify valid SPDX inputs
  • Constructor Details

    • ModelObject

      public ModelObject() throws InvalidSPDXAnalysisException
      Create a new Model Object using an Anonymous ID with the defualt store and default document URI
      Throws:
      InvalidSPDXAnalysisException
    • ModelObject

      public ModelObject(String id) throws InvalidSPDXAnalysisException
      Open or create a model object with the default store and default document URI
      Parameters:
      id - ID for this object - must be unique within the SPDX document
      Throws:
      InvalidSPDXAnalysisException
    • ModelObject

      public ModelObject(IModelStore modelStore, String documentUri, String id, @Nullable ModelCopyManager copyManager, boolean create) throws InvalidSPDXAnalysisException
      Parameters:
      modelStore - Storage for the model objects
      documentUri - SPDX Document URI for a document associated with this model
      id - ID for this object - must be unique within the SPDX document
      copyManager - - if supplied, model objects will be implictly copied into this model store and document URI when referenced by setting methods
      create - - if true, the object will be created in the store if it is not already present
      Throws:
      InvalidSPDXAnalysisException
  • Method Details

    • getType

      public abstract String getType()
      Returns:
      The class name for this object. Class names are defined in the constants file
    • _verify

      protected abstract List<String> _verify(Set<String> verifiedElementIds, String specVersion)
      Implementation of the specific verifications for this model object
      Parameters:
      specVersion - Version of the SPDX spec to verify against
      verifiedElementIds - list of all Element Id's which have already been verified - prevents infinite recursion
      Returns:
      Any verification errors or warnings associated with this object
    • verify

      public List<String> verify(Set<String> verifiedIElementds, String specVersion)
      Parameters:
      specVersion - Version of the SPDX spec to verify against
      verifiedIElementds - list of all element Id's which have already been verified - prevents infinite recursion
      Returns:
      Any verification errors or warnings associated with this object
    • verify

      public List<String> verify()
      Verifies against the more recent supported specification version
      Returns:
      Any verification errors or warnings associated with this object
    • verify

      public List<String> verify(String specVersion)
      Parameters:
      specVersion - Version of the SPDX spec to verify against
      Returns:
      Any verification errors or warnings associated with this object
    • getDocumentUri

      public String getDocumentUri()
      Returns:
      the Document URI for this object
    • getId

      public String getId()
      Returns:
      ID for the object
    • getModelStore

      public IModelStore getModelStore()
      Returns:
      the model store for this object
    • isStrict

      public boolean isStrict()
      Returns:
      if strict input checking is enabled
    • setStrict

      public void setStrict(boolean strict)
      Parameters:
      strict - if true, inputs will be validated against the SPDX spec
    • enterCriticalSection

      public IModelStore.IModelStoreLock enterCriticalSection(boolean readLockRequested) throws InvalidSPDXAnalysisException
      Enter a critical section. leaveCriticialSection must be called.
      Parameters:
      readLockRequested - true implies a read lock, false implies write lock.
      Throws:
      InvalidSPDXAnalysisException
    • leaveCriticalSection

      public void leaveCriticalSection(IModelStore.IModelStoreLock lock)
      Leave a critical section. Releases the lock form the matching enterCriticalSection
    • getPropertyValueNames

      public List<String> getPropertyValueNames() throws InvalidSPDXAnalysisException
      Returns:
      all names of property values currently associated with this object
      Throws:
      InvalidSPDXAnalysisException
    • getObjectPropertyValue

      protected Optional<Object> getObjectPropertyValue(String propertyName) throws InvalidSPDXAnalysisException
      Get an object value for a property
      Parameters:
      propertyName - Name of the property
      Returns:
      value associated with a property
      Throws:
      InvalidSPDXAnalysisException
    • getObjectPropertyValue

      protected static Optional<Object> getObjectPropertyValue(IModelStore stModelStore, String stDocumentUri, String stId, String propertyName, ModelCopyManager copyManager) throws InvalidSPDXAnalysisException
      Get an object value for a property
      Parameters:
      stModelStore -
      stDocumentUri -
      stId -
      propertyName -
      copyManager - if non null, any ModelObject property value not stored in the stModelStore under the stDocumentUri will be copied to make it available
      Returns:
      value associated with a property
      Throws:
      InvalidSPDXAnalysisException
    • setPropertyValue

      protected static void setPropertyValue(IModelStore stModelStore, String stDocumentUri, String stId, String propertyName, @Nullable Object value, ModelCopyManager copyManager) throws InvalidSPDXAnalysisException
      Set a property value for a property name, creating the property if necessary
      Parameters:
      stModelStore - Model store for the properties
      stDocumentUri - Unique document URI
      stId - ID of the item to associate the property with
      propertyName - Name of the property associated with this object
      value - Value to associate with the property
      copyManager - if non null, any ModelObject property value not stored in the stModelStore under the stDocumentUri will be copied to make it available
      Throws:
      InvalidSPDXAnalysisException
    • setPropertyValue

      protected void setPropertyValue(String propertyName, @Nullable Object value) throws InvalidSPDXAnalysisException
      Set a property value for a property name, creating the property if necessary
      Parameters:
      propertyName - Name of the property associated with this object
      value - Value to associate with the property
      Throws:
      InvalidSPDXAnalysisException
    • updatePropertyValue

      protected IModelStore.ModelUpdate updatePropertyValue(String propertyName, Object value)
      Create an update when, when applied by the ModelStore, sets a property value for a property name, creating the property if necessary
      Parameters:
      propertyName - Name of the property associated with this object
      value - Value to associate with the property
      Returns:
      an update which can be applied by invoking the apply method
    • getStringPropertyValue

      protected Optional<String> getStringPropertyValue(String propertyName) throws InvalidSPDXAnalysisException
      Parameters:
      propertyName - Name of a property
      Returns:
      the Optional String value associated with a property, null if no value is present
      Throws:
      SpdxInvalidTypeException
      InvalidSPDXAnalysisException
    • getIntegerPropertyValue

      protected Optional<Integer> getIntegerPropertyValue(String propertyName) throws InvalidSPDXAnalysisException
      Parameters:
      propertyName - Name of a property
      Returns:
      the Optional Integer value associated with a property, null if no value is present
      Throws:
      InvalidSPDXAnalysisException
    • getEnumPropertyValue

      protected Optional<Enum<?>> getEnumPropertyValue(String propertyName) throws InvalidSPDXAnalysisException
      Throws:
      InvalidSPDXAnalysisException
    • getBooleanPropertyValue

      protected Optional<Boolean> getBooleanPropertyValue(String propertyName) throws InvalidSPDXAnalysisException
      Parameters:
      propertyName - Name of the property
      Returns:
      the Optional Boolean value for a property
      Throws:
      SpdxInvalidTypeException
      InvalidSPDXAnalysisException
    • getAnyLicenseInfoPropertyValue

      protected Optional<AnyLicenseInfo> getAnyLicenseInfoPropertyValue(String propertyName) throws InvalidSPDXAnalysisException
      Converts property values to an AnyLicenseInfo if possible - if NONE or NOASSERTION URI value, convert to the appropriate license
      Parameters:
      propertyName -
      Returns:
      AnyLicenseInfo
      Throws:
      InvalidSPDXAnalysisException
    • getElementPropertyValue

      protected Optional<SpdxElement> getElementPropertyValue(String propertyName) throws InvalidSPDXAnalysisException
      Converts property values to an SpdxElement if possible - if NONE or NOASSERTION URI value, convert to the appropriate SpdxElement
      Parameters:
      propertyName - name of the property
      Returns:
      SpdxElement stored
      Throws:
      InvalidSPDXAnalysisException
    • removeProperty

      protected static void removeProperty(IModelStore stModelStore, String stDocumentUri, String stId, String propertyName) throws InvalidSPDXAnalysisException
      Removes a property and its value from the model store if it exists
      Parameters:
      stModelStore - Model store for the properties
      stDocumentUri - Unique document URI
      stId - ID of the item to associate the property with
      propertyName - Name of the property associated with this object to be removed
      Throws:
      InvalidSPDXAnalysisException
    • removeProperty

      protected void removeProperty(String propertyName) throws InvalidSPDXAnalysisException
      Removes a property and its value from the model store if it exists
      Parameters:
      propertyName - Name of the property associated with this object to be removed
      Throws:
      InvalidSPDXAnalysisException
    • updateRemoveProperty

      protected IModelStore.ModelUpdate updateRemoveProperty(String propertyName)
      Create an update when, when applied by the ModelStore, removes a property and its value from the model store if it exists
      Parameters:
      propertyName - Name of the property associated with this object to be removed
      Returns:
      an update which can be applied by invoking the apply method
    • clearValueCollection

      protected static void clearValueCollection(IModelStore stModelStore, String stDocumentUri, String stId, String propertyName) throws InvalidSPDXAnalysisException
      Clears a collection of values associated with a property creating the property if it does not exist
      Parameters:
      stModelStore - Model store for the properties
      stDocumentUri - Unique document URI
      stId - ID of the item to associate the property with
      propertyName - Name of the property
      Throws:
      InvalidSPDXAnalysisException
    • clearValueCollection

      protected void clearValueCollection(String propertyName) throws InvalidSPDXAnalysisException
      Clears a collection of values associated with a property
      Parameters:
      propertyName - Name of the property
      Throws:
      InvalidSPDXAnalysisException
    • updateClearValueCollection

      protected IModelStore.ModelUpdate updateClearValueCollection(String propertyName)
      Create an update when, when applied by the ModelStore, clears a collection of values associated with a property
      Parameters:
      propertyName - Name of the property
      Returns:
      an update which can be applied by invoking the apply method
    • addValueToCollection

      protected static void addValueToCollection(IModelStore stModelStore, String stDocumentUri, String stId, String propertyName, Object value, ModelCopyManager copyManager) throws InvalidSPDXAnalysisException
      Add a value to a collection of values associated with a property. If a value is a ModelObject and does not belong to the document, it will be copied into the object store
      Parameters:
      stModelStore - Model store for the properties
      stDocumentUri - Unique document URI
      stId - ID of the item to associate the property with
      propertyName - Name of the property
      value - to add
      copyManager -
      Throws:
      InvalidSPDXAnalysisException
    • addPropertyValueToCollection

      protected void addPropertyValueToCollection(String propertyName, Object value) throws InvalidSPDXAnalysisException
      Add a value to a collection of values associated with a property. If a value is a ModelObject and does not belong to the document, it will be copied into the object store
      Parameters:
      propertyName - Name of the property
      value - to add
      Throws:
      InvalidSPDXAnalysisException
    • updateAddPropertyValueToCollection

      protected IModelStore.ModelUpdate updateAddPropertyValueToCollection(String propertyName, Object value)
      Create an update when, when applied, adds a value to a collection of values associated with a property. If a value is a ModelObject and does not belong to the document, it will be copied into the object store
      Parameters:
      propertyName - Name of the property
      value - to add
      Returns:
      an update which can be applied by invoking the apply method
    • replacePropertyValueCollection

      protected static void replacePropertyValueCollection(IModelStore stModelStore, String stDocumentUri, String stId, String propertyName, Collection<?> values, ModelCopyManager copyManager) throws InvalidSPDXAnalysisException
      Replace the entire value collection for a property. If a value is a ModelObject and does not belong to the document, it will be copied into the object store
      Parameters:
      stModelStore - Model store for the properties
      stDocumentUri - Unique document URI
      stId - ID of the item to associate the property with
      propertyName - name of the property
      values - collection of new properties
      copyManager - if non-null, any ModelObject property value not stored in the stModelStore under the stDocumentUri will be copied to make it available
      Throws:
      InvalidSPDXAnalysisException
    • removePropertyValueFromCollection

      protected static void removePropertyValueFromCollection(IModelStore stModelStore, String stDocumentUri, String stId, String propertyName, Object value) throws InvalidSPDXAnalysisException
      Remove a property value from a collection
      Parameters:
      stModelStore - Model store for the properties
      stDocumentUri - Unique document URI
      stId - ID of the item to associate the property with
      propertyName - name of the property
      value - Value to be removed
      Throws:
      InvalidSPDXAnalysisException
    • removePropertyValueFromCollection

      protected void removePropertyValueFromCollection(String propertyName, Object value) throws InvalidSPDXAnalysisException
      Remove a property value from a collection
      Parameters:
      propertyName - name of the property
      value - Value to be removed
      Throws:
      InvalidSPDXAnalysisException
    • updateRemovePropertyValueFromCollection

      protected IModelStore.ModelUpdate updateRemovePropertyValueFromCollection(String propertyName, Object value)
      Create an update when, when applied, removes a property value from a collection
      Parameters:
      propertyName - name of the property
      value - Value to be removed
      Returns:
      an update which can be applied by invoking the apply method
    • getObjectPropertyValueSet

      protected ModelSet<?> getObjectPropertyValueSet(String propertyName, Class<?> type) throws InvalidSPDXAnalysisException
      Parameters:
      propertyName - Name of the property
      Returns:
      Set of values associated with a property
      Throws:
      InvalidSPDXAnalysisException
    • getObjectPropertyValueCollection

      protected ModelCollection<?> getObjectPropertyValueCollection(String propertyName, Class<?> type) throws InvalidSPDXAnalysisException
      Parameters:
      propertyName - Name of the property
      Returns:
      Collection of values associated with a property
      Throws:
      InvalidSPDXAnalysisException
    • getStringCollection

      protected Collection<String> getStringCollection(String propertyName) throws InvalidSPDXAnalysisException
      Parameters:
      propertyName - Name of property
      Returns:
      Collection of Strings associated with the property
      Throws:
      SpdxInvalidTypeException
      InvalidSPDXAnalysisException
    • isCollectionMembersAssignableTo

      protected boolean isCollectionMembersAssignableTo(String propertyName, Class<?> clazz) throws InvalidSPDXAnalysisException
      Throws:
      InvalidSPDXAnalysisException
    • equivalent

      public boolean equivalent(ModelObject compare) throws InvalidSPDXAnalysisException
      Parameters:
      compare -
      Returns:
      true if all the properties have the same or equivalent values
      Throws:
      InvalidSPDXAnalysisException
    • equivalent

      public boolean equivalent(ModelObject compare, boolean ignoreRelatedElements) throws InvalidSPDXAnalysisException
      Parameters:
      compare -
      ignoreRelatedElements - if true, do not compare properties relatedSpdxElement - used to prevent infinite recursion
      Returns:
      true if all the properties have the same or equivalent values
      Throws:
      InvalidSPDXAnalysisException
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • clone

      public ModelObject clone(IModelStore modelStore)
      Clone a new object using a different model store
      Parameters:
      modelStore -
      Returns:
    • copyFrom

      public void copyFrom(ModelObject source) throws InvalidSPDXAnalysisException
      Copy all the properties from the source object
      Parameters:
      source -
      Throws:
      InvalidSPDXAnalysisException
    • setCopyManager

      public void setCopyManager(ModelCopyManager copyManager)
    • getCopyManager

      public ModelCopyManager getCopyManager()
      Returns:
      the copy manager - value may be null if copies are not allowd
    • idToIdType

      protected IModelStore.IdType idToIdType(String id)
      Parameters:
      id - String for the object
      Returns:
      type of the ID
    • toTypedValue

      protected TypedValue toTypedValue() throws InvalidSPDXAnalysisException
      Throws:
      InvalidSPDXAnalysisException
    • verifyCollection

      protected List<String> verifyCollection(Collection<? extends ModelObject> collection, String warningPrefix, Set<String> verifiedIds, String specVersion)
      Verifies all elements in a collection
      Parameters:
      specVersion - version of the SPDX specification to verify against
      collection - collection to be verifies
      verifiedIds - verifiedIds list of all Id's which have already been verifieds - prevents infinite recursion
      warningPrefix - String to prefix any warning messages
    • createAnnotation

      public Annotation createAnnotation(String annotator, AnnotationType annotationType, String date, String comment) throws InvalidSPDXAnalysisException
      Parameters:
      annotator - This field identifies the person, organization or tool that has commented on a file, package, or the entire document.
      annotationType - This field describes the type of annotation. Annotations are usually created when someone reviews the file, and if this is the case the annotation type should be REVIEW. If the author wants to store extra information about one of the elements during creation, it is recommended to use the type of OTHER.
      date - Identify when the comment was made. This is to be specified according to the combined date and time in the UTC format, as specified in the ISO 8601 standard.
      comment -
      Returns:
      Throws:
      InvalidSPDXAnalysisException
    • createRelationship

      public Relationship createRelationship(SpdxElement relatedElement, RelationshipType relationshipType, @Nullable String comment) throws InvalidSPDXAnalysisException
      Parameters:
      relatedElement - The SPDX Element that is related
      relationshipType - Type of relationship - See the specification for a description of the types
      comment - optional comment for the relationship
      Returns:
      Throws:
      InvalidSPDXAnalysisException
    • createChecksum

      public Checksum createChecksum(ChecksumAlgorithm algorithm, String value) throws InvalidSPDXAnalysisException
      Parameters:
      algorithm - Checksum algorithm
      value - Checksum value
      Returns:
      Checksum using the same model store and document URI as this Model Object
      Throws:
      InvalidSPDXAnalysisException
    • createPackageVerificationCode

      public SpdxPackageVerificationCode createPackageVerificationCode(String value, Collection<String> excludedFileNames) throws InvalidSPDXAnalysisException
      Parameters:
      value - Verification code calculated value
      excludedFileNames - file names of files excluded from the verification code calculation
      Returns:
      Package verification code using the same model store and document URI as this Model Object
      Throws:
      InvalidSPDXAnalysisException
    • createExternalDocumentRef

      public ExternalDocumentRef createExternalDocumentRef(String externalDocumentId, String externalDocumentUri, Checksum checksum) throws InvalidSPDXAnalysisException
      Parameters:
      externalDocumentUri - Document URI for the external document
      checksum - Checksum of the external Document
      externalDocumentId - ID to be used internally within this SPDX document
      Returns:
      ExternalDocumentRef using the same model store and document URI as this Model Object
      Throws:
      InvalidSPDXAnalysisException
    • createCreationInfo

      public SpdxCreatorInformation createCreationInfo(List<String> creators, String date) throws InvalidSPDXAnalysisException
      Parameters:
      creators - Creators Identify who (or what, in the case of a tool) created the SPDX file. If the SPDX file was created by an individual, indicate the person's name.
      date - When the SPDX file was originally created. The date is to be specified according to combined date and time in UTC format as specified in ISO 8601 standard.
      Returns:
      creationInfo using the same modelStore and documentUri as this object
      Throws:
      InvalidSPDXAnalysisException
    • createExternalRef

      public ExternalRef createExternalRef(ReferenceCategory category, ReferenceType referenceType, String locator, @Nullable String comment) throws InvalidSPDXAnalysisException
      Parameters:
      category - Reference category
      referenceType - Reference type
      locator - Reference locator
      comment - Optional comment
      Returns:
      ExternalRef using the same modelStore and documentUri as this object
      Throws:
      InvalidSPDXAnalysisException
    • createSpdxFile

      public SpdxFile.SpdxFileBuilder createSpdxFile(String id, String name, AnyLicenseInfo concludedLicense, Collection<AnyLicenseInfo> seenLicense, String copyrightText, Checksum sha1) throws InvalidSPDXAnalysisException
      Create an SpdxFileBuilder with all of the required properties - the build() method will build the file
      Parameters:
      id - - ID - must be an SPDX ID type
      name - - File name
      concludedLicense - license concluded
      seenLicense - collection of seen licenses
      copyrightText - Copyright text
      sha1 - Sha1 checksum
      Returns:
      SPDX file using the same modelStore and documentUri as this object
      Throws:
      InvalidSPDXAnalysisException
    • createPackage

      public SpdxPackage.SpdxPackageBuilder createPackage(String id, String name, AnyLicenseInfo concludedLicense, String copyrightText, AnyLicenseInfo licenseDeclared)
      Create an SpdxPackageBuilder with all required fields for a filesAnalyzed=false using this objects model store and document URI
      Parameters:
      id - - ID - must be an SPDX ID type
      name - - File name
      concludedLicense - license concluded
      copyrightText - Copyright text
      licenseDeclared - Declared license for the package
      Returns:
      SpdxPackageBuilder with all required fields for a filesAnalyzed=false
    • createByteOffsetPointer

      public ByteOffsetPointer createByteOffsetPointer(SpdxElement referencedElement, int offset) throws InvalidSPDXAnalysisException
      Parameters:
      referencedElement -
      offset -
      Returns:
      ByteOffsetPointer using the same modelStore and documentUri as this object
      Throws:
      InvalidSPDXAnalysisException
    • createLineCharPointer

      public LineCharPointer createLineCharPointer(SpdxElement referencedElement, int lineNumber) throws InvalidSPDXAnalysisException
      Parameters:
      referencedElement -
      lineNumber -
      Returns:
      LineCharPointer using the same modelStore and documentUri as this object
      Throws:
      InvalidSPDXAnalysisException
    • createStartEndPointer

      public StartEndPointer createStartEndPointer(SinglePointer startPointer, SinglePointer endPointer) throws InvalidSPDXAnalysisException
      Parameters:
      startPointer -
      endPointer -
      Returns:
      StartEndPointer using the same modelStore and documentUri as this object
      Throws:
      InvalidSPDXAnalysisException
    • createSpdxSnippet

      public SpdxSnippet.SpdxSnippetBuilder createSpdxSnippet(String id, String name, AnyLicenseInfo concludedLicense, Collection<AnyLicenseInfo> seenLicense, String copyrightText, SpdxFile snippetFromFile, int startByte, int endByte) throws InvalidSPDXAnalysisException
      Create an SpdxSnippetBuilder with all of the required properties - the build() method will build the file
      Parameters:
      id - - ID - must be an SPDX ID type
      name - - File name
      concludedLicense - license concluded
      seenLicense - collection of seen licenses
      copyrightText - Copyright text
      snippetFromFile - File where the snippet is located
      startByte - first byte of the snippet in the file
      endByte - last byte of the snippet in the file
      Returns:
      SPDX snippet using the same modelStore and documentUri as this object
      Throws:
      InvalidSPDXAnalysisException
    • createConjunctiveLicenseSet

      public ConjunctiveLicenseSet createConjunctiveLicenseSet(Collection<AnyLicenseInfo> members) throws InvalidSPDXAnalysisException
      Parameters:
      members -
      Returns:
      ConjunctiveLicenseSet with default model store and document URI initialized with members
      Throws:
      InvalidSPDXAnalysisException
    • createDisjunctiveLicenseSet

      public DisjunctiveLicenseSet createDisjunctiveLicenseSet(Collection<AnyLicenseInfo> members) throws InvalidSPDXAnalysisException
      Parameters:
      members -
      Returns:
      DisjunctiveLicenseSet with default model store and document URI initialized with members
      Throws:
      InvalidSPDXAnalysisException
    • createCrossRef

      public CrossRef.CrossRefBuilder createCrossRef(String url) throws InvalidSPDXAnalysisException
      Create a CrossRef Builder with an Anonymous ID type using the same model store and document URI
      Parameters:
      url - URL for the cross reference
      Returns:
      a CrossRefBuilder which you can call build() on to build the CrossRef
      Throws:
      InvalidSPDXAnalysisException
    • createExtractedLicense

      public ExtractedLicenseInfo createExtractedLicense(String id, String text) throws InvalidSPDXAnalysisException
      Constructs ExtractedLicenseInfo with text set.

      Note that object construction has side-effects relating to a document and modelStore, requiring document context. This may bind usage of ExtractedLicenseInfo instances to the document that they were created by!

      Parameters:
      id - id that the text relates to
      text - license text corresponding to the id
      Returns:
      returns a constructed object
      Throws:
      InvalidSPDXAnalysisException
    • toString

      public String toString()
      Overrides:
      toString in class Object