Class InvalidLicenseExpression
- java.lang.Object
-
- org.spdx.core.CoreModelObject
-
- org.spdx.library.model.v2.ModelObjectV2
-
- org.spdx.library.model.v2.license.AnyLicenseInfo
-
- org.spdx.library.model.v2.license.InvalidLicenseExpression
-
public class InvalidLicenseExpression extends AnyLicenseInfo
Represents a license expression string which can not be parsed - used for error handling
-
-
Field Summary
Fields Modifier and Type Field Description static String
INVALID_LICENSE_EXPRESSION_TYPE
static org.spdx.storage.PropertyDescriptor
LICENSE_EXPRESSION_PROPERTY
static org.spdx.storage.PropertyDescriptor
MESSAGE_PROPERTY
-
Fields inherited from class org.spdx.library.model.v2.ModelObjectV2
LATEST_SPDX_2_VERSION
-
-
Constructor Summary
Constructors Constructor Description InvalidLicenseExpression(org.spdx.storage.IModelStore modelStore, String documentUri, String id, org.spdx.core.IModelCopyManager copyManager, boolean create)
Create a new InvalidLicenseExpression objectInvalidLicenseExpression(org.spdx.storage.IModelStore modelStore, String documentUri, String id, org.spdx.core.IModelCopyManager copyManager, String message, String licenseExpression)
Create a new InvalidLicenseExpression object and initializes the message and licenseExpression
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>
_verify(Set<String> verifiedElementIds, String specVersion)
Implementation of the specific verifications for this model objectString
getLicenseExpression()
String
getMessage()
String
getType()
void
setLicenseExpression(String expression)
void
setMessage(String message)
String
toString()
-
Methods inherited from class org.spdx.library.model.v2.ModelObjectV2
_verify, createAnnotation, createByteOffsetPointer, createChecksum, createConjunctiveLicenseSet, createCreationInfo, createCrossRef, createDisjunctiveLicenseSet, createExternalDocumentRef, createExternalRef, createExtractedLicense, createLineCharPointer, createPackage, createPackageVerificationCode, createRelationship, createSpdxFile, createSpdxSnippet, createStartEndPointer, equals, getAnyLicenseInfoPropertyValue, getDocumentUri, getElementPropertyValue, getId, hashCode, isEquivalentToNull, isNoAssertion, isRelatedElement, toTypedValue, verify
-
Methods inherited from class org.spdx.core.CoreModelObject
addPropertyValueToCollection, clearValueCollection, clone, copyFrom, enterCriticalSection, equivalent, equivalent, getBooleanPropertyValue, getCopyManager, getDoublePropertyValue, getEnumPropertyValue, getIdPrefix, getIntegerPropertyValue, getModelStore, getObjectPropertyValue, getObjectPropertyValue, getObjectPropertyValueCollection, getObjectPropertyValueSet, getObjectUri, getPropertyValueDescriptors, getSpecVersion, getStringCollection, getStringPropertyValue, isCollectionMembersAssignableTo, isExternal, isStrict, leaveCriticalSection, removeProperty, removePropertyValueFromCollection, setCopyManager, setIdPrefix, setPropertyValue, setStrict, updateAddPropertyValueToCollection, updateClearValueCollection, updatePropertyValue, updateRemoveProperty, updateRemovePropertyValueFromCollection, verify, verify, verifyCollection
-
-
-
-
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
-
INVALID_LICENSE_EXPRESSION_TYPE
public static final String INVALID_LICENSE_EXPRESSION_TYPE
- See Also:
- Constant Field Values
-
-
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 licensedocumentUri
- URI for the SPDX document containing the licenseid
- identifier for the licensecopyManager
- if non-null, allows for copying of any properties set which use other model stores or document URI'screate
- 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 licensedocumentUri
- URI for the SPDX document containing the licenseid
- identifier for the licensecopyManager
- if non-null, allows for copying of any properties set which use other model stores or document URI'smessage
- Error message describing the nature of the invalid license expressionlicenseExpression
- 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 classModelObjectV2
- Parameters:
verifiedElementIds
- list of all Element Id's which have already been verified - prevents infinite recursionspecVersion
- 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 classorg.spdx.core.CoreModelObject
-
toString
public String toString()
- Specified by:
toString
in classAnyLicenseInfo
-
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
-
-