Class SpdxConstantElement

  • All Implemented Interfaces:
    org.spdx.core.IndividualUriValue
    Direct Known Subclasses:
    SpdxNoAssertionElement, SpdxNoneElement

    public abstract class SpdxConstantElement
    extends SpdxElement
    implements org.spdx.core.IndividualUriValue
    Type of SpdxElement which is a constant unmodifiable element
    Author:
    Gary O'Neall
    • Constructor Detail

      • SpdxConstantElement

        public SpdxConstantElement​(String id)
                            throws org.spdx.core.InvalidSPDXAnalysisException
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • SpdxConstantElement

        public SpdxConstantElement​(org.spdx.storage.IModelStore modelStore,
                                   String documentUri,
                                   String id)
                            throws org.spdx.core.InvalidSPDXAnalysisException
        Parameters:
        modelStore - where the model is stored
        documentUri - Unique document URI
        id - ID for the constant element
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
    • Method Detail

      • isExternal

        public boolean isExternal()
        Overrides:
        isExternal in class org.spdx.core.CoreModelObject
      • _verify

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

        public String getType()
        Specified by:
        getType in class org.spdx.core.CoreModelObject
      • getAnnotations

        public Collection<Annotation> getAnnotations()
                                              throws org.spdx.core.InvalidSPDXAnalysisException
        Overrides:
        getAnnotations in class SpdxElement
        Returns:
        Annotations
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setAnnotations

        public SpdxElement setAnnotations​(Collection<Annotation> annotations)
                                   throws org.spdx.core.InvalidSPDXAnalysisException
        Description copied from class: SpdxElement
        Clears and resets the annotations collection to the parameter
        Overrides:
        setAnnotations in class SpdxElement
        Returns:
        this to chain setters
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • addAnnotation

        public boolean addAnnotation​(Annotation annotation)
                              throws org.spdx.core.InvalidSPDXAnalysisException
        Description copied from class: SpdxElement
        Add an annotation
        Overrides:
        addAnnotation in class SpdxElement
        Returns:
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • removeAnnotation

        public boolean removeAnnotation​(Annotation annotation)
                                 throws org.spdx.core.InvalidSPDXAnalysisException
        Description copied from class: SpdxElement
        Remove an annotation
        Overrides:
        removeAnnotation in class SpdxElement
        Returns:
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • getRelationships

        public Collection<Relationship> getRelationships()
                                                  throws org.spdx.core.InvalidSPDXAnalysisException
        Overrides:
        getRelationships in class SpdxElement
        Returns:
        Relationships
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setRelationships

        public SpdxElement setRelationships​(Collection<Relationship> relationships)
                                     throws org.spdx.core.InvalidSPDXAnalysisException
        Description copied from class: SpdxElement
        clear and reset the relationships to the parameter relationship
        Overrides:
        setRelationships in class SpdxElement
        Returns:
        this to chain sets
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • addRelationship

        public boolean addRelationship​(Relationship relationship)
                                throws org.spdx.core.InvalidSPDXAnalysisException
        Description copied from class: SpdxElement
        Add a relationship
        Overrides:
        addRelationship in class SpdxElement
        Returns:
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • removeRelationship

        public boolean removeRelationship​(Relationship relationship)
                                   throws org.spdx.core.InvalidSPDXAnalysisException
        Description copied from class: SpdxElement
        Remove a relationship
        Overrides:
        removeRelationship in class SpdxElement
        Returns:
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setComment

        public void setComment​(String comment)
                        throws org.spdx.core.InvalidSPDXAnalysisException
        Description copied from class: SpdxElement
        Sets the comment
        Overrides:
        setComment in class SpdxElement
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setName

        public SpdxElement setName​(String name)
                            throws org.spdx.core.InvalidSPDXAnalysisException
        Description copied from class: SpdxElement
        Set the name
        Overrides:
        setName in class SpdxElement
        Returns:
        this so that you can chain setters
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException