Class LicenseException

  • Direct Known Subclasses:
    ListedLicenseException

    public abstract class LicenseException
    extends ModelObjectV2
    Represents an SPDX license exception as defined in the License Expression Language Used with the "with" unary expression.
    Author:
    Gary O'Neall
    • Constructor Detail

      • LicenseException

        public LicenseException​(org.spdx.storage.IModelStore modelStore,
                                String documentUri,
                                String id,
                                @Nullable
                                org.spdx.core.IModelCopyManager copyManager,
                                boolean create)
                         throws org.spdx.core.InvalidSPDXAnalysisException
        Create a new LicenseException object
        Parameters:
        modelStore - container which includes the license exception
        documentUri - URI for the SPDX document containing the license exception
        id - identifier for the license exception
        copyManager - if non-null, allows for copying of any properties set which use other model stores or document URI's
        create - if true, create the license exception if it does not exist
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • LicenseException

        public LicenseException​(String id,
                                String name,
                                String text,
                                Collection<String> seeAlso,
                                String comment)
                         throws org.spdx.core.InvalidSPDXAnalysisException
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • LicenseException

        public LicenseException​(String id,
                                String name,
                                String text,
                                String template,
                                Collection<String> seeAlso,
                                String comment)
                         throws org.spdx.core.InvalidSPDXAnalysisException
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • LicenseException

        public LicenseException​(String id,
                                String name,
                                String text)
                         throws org.spdx.core.InvalidSPDXAnalysisException
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
    • Method Detail

      • getComment

        public String getComment()
                          throws org.spdx.core.InvalidSPDXAnalysisException
        Returns:
        Comment associated with the License Exception
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setComment

        public void setComment​(String comment)
                        throws org.spdx.core.InvalidSPDXAnalysisException
        Parameters:
        comment - the comment to set
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • getExample

        @Deprecated
        public String getExample()
                          throws org.spdx.core.InvalidSPDXAnalysisException
        Deprecated.
        Deprecated since SPDX spec 2.0
        Returns:
        example text
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setExample

        @Deprecated
        public void setExample​(String example)
                        throws org.spdx.core.InvalidSPDXAnalysisException
        Deprecated.
        Deprecated since SPDX spec 2.0
        Parameters:
        example -
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • getLicenseExceptionId

        public String getLicenseExceptionId()
        Returns:
        the objectUri
      • getLicenseExceptionTemplate

        public String getLicenseExceptionTemplate()
                                           throws org.spdx.core.InvalidSPDXAnalysisException
        Returns:
        the template
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setLicenseExceptionTemplate

        public void setLicenseExceptionTemplate​(String template)
                                         throws org.spdx.core.InvalidSPDXAnalysisException
        Set the template text for the exception
        Parameters:
        template - template
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • getLicenseExceptionText

        public String getLicenseExceptionText()
                                       throws org.spdx.core.InvalidSPDXAnalysisException
        Returns:
        the text
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setLicenseExceptionText

        public void setLicenseExceptionText​(String text)
                                     throws org.spdx.core.InvalidSPDXAnalysisException
        Sets the text for the exception
        Parameters:
        text - text
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • getName

        public String getName()
                       throws org.spdx.core.InvalidSPDXAnalysisException
        Returns:
        the name
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setName

        public void setName​(String name)
                     throws org.spdx.core.InvalidSPDXAnalysisException
        Parameters:
        name - the name to set
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • getSeeAlso

        public Collection<String> getSeeAlso()
                                      throws org.spdx.core.InvalidSPDXAnalysisException
        Returns:
        the urls which reference the same license information
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setSeeAlso

        public void setSeeAlso​(Collection<String> seeAlso)
                        throws org.spdx.core.InvalidSPDXAnalysisException
        Parameters:
        seeAlso - the urls which are references to the same license to set
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • isDeprecated

        public boolean isDeprecated()
                             throws org.spdx.core.InvalidSPDXAnalysisException
        Returns:
        true if this license is marked as being deprecated
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setDeprecated

        public void setDeprecated​(Boolean deprecated)
                           throws org.spdx.core.InvalidSPDXAnalysisException
        Parameters:
        deprecated - true if this license is deprecated
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • getDeprecatedVersion

        public String getDeprecatedVersion()
                                    throws org.spdx.core.InvalidSPDXAnalysisException
        Returns:
        the deprecatedVersion
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • setDeprecatedVersion

        public void setDeprecatedVersion​(String deprecatedVersion)
                                  throws org.spdx.core.InvalidSPDXAnalysisException
        Parameters:
        deprecatedVersion - the deprecatedVersion to set
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException
      • getType

        public String getType()
        Specified by:
        getType 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
        Specified by:
        _verify in class ModelObjectV2
        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