Class InvalidLicenseExpression


  • public class InvalidLicenseExpression
    extends AnyLicenseInfo
    Represents a license expression string which can not be parsed - used for error handling
    • Field Detail

      • MESSAGE_PROPERTY

        public static final org.spdx.storage.PropertyDescriptor MESSAGE_PROPERTY
      • LICENSE_EXPRESSION_PROPERTY

        public static final org.spdx.storage.PropertyDescriptor LICENSE_EXPRESSION_PROPERTY
    • Constructor Detail

      • InvalidLicenseExpression

        public InvalidLicenseExpression​(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 InvalidLicenseExpression object
        Parameters:
        modelStore - container which includes the license
        documentUri - URI for the SPDX document containing the license
        id - identifier for the license
        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 if it does not exist
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException - on error
      • InvalidLicenseExpression

        public InvalidLicenseExpression​(org.spdx.storage.IModelStore modelStore,
                                        String documentUri,
                                        String id,
                                        @Nullable
                                        org.spdx.core.IModelCopyManager copyManager,
                                        String message,
                                        String licenseExpression)
                                 throws org.spdx.core.InvalidSPDXAnalysisException
        Create a new InvalidLicenseExpression object and initializes the message and licenseExpression
        Parameters:
        modelStore - container which includes the license
        documentUri - URI for the SPDX document containing the license
        id - identifier for the license
        copyManager - if non-null, allows for copying of any properties set which use other model stores or document URI's
        message - Error message describing the nature of the invalid license expression
        licenseExpression - License expression string that caused the error
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException - on error
    • Method Detail

      • _verify

        protected List<String> _verify​(Set<String> verifiedElementIds,
                                       String specVersion)
        Description copied from class: ModelObjectV2
        Implementation of the specific verifications for this model object
        Specified by:
        _verify in class ModelObjectV2
        Parameters:
        verifiedElementIds - 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
      • getMessage

        public String getMessage()
                          throws org.spdx.core.InvalidSPDXAnalysisException
        Returns:
        the error message associated with the license expression
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException - on storage related errors
      • setMessage

        public void setMessage​(String message)
                        throws org.spdx.core.InvalidSPDXAnalysisException
        Parameters:
        message - the message to set
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException - on storage related errors
      • getLicenseExpression

        public String getLicenseExpression()
                                    throws org.spdx.core.InvalidSPDXAnalysisException
        Returns:
        the license expression which had parsing errors
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException - on storage related errors
      • setLicenseExpression

        public void setLicenseExpression​(String expression)
                                  throws org.spdx.core.InvalidSPDXAnalysisException
        Parameters:
        expression - the license expression to set
        Throws:
        org.spdx.core.InvalidSPDXAnalysisException - on storage related errors