Class LicenseException
- java.lang.Object
-
- org.spdx.core.CoreModelObject
-
- org.spdx.library.model.v2.ModelObjectV2
-
- org.spdx.library.model.v2.license.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
-
-
Field Summary
-
Fields inherited from class org.spdx.library.model.v2.ModelObjectV2
LATEST_SPDX_2_VERSION
-
-
Constructor Summary
Constructors Constructor Description LicenseException(String id, String name, String text)
LicenseException(String id, String name, String text, String template, Collection<String> seeAlso, String comment)
LicenseException(String id, String name, String text, Collection<String> seeAlso, String comment)
LicenseException(org.spdx.storage.IModelStore modelStore, String documentUri, String id, org.spdx.core.IModelCopyManager copyManager, boolean create)
Create a new LicenseException object
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected List<String>
_verify(Set<String> verifiedIds, String specVersion)
Implementation of the specific verifications for this model objectString
getComment()
String
getDeprecatedVersion()
String
getExample()
Deprecated.String
getLicenseExceptionId()
String
getLicenseExceptionTemplate()
String
getLicenseExceptionText()
String
getName()
Collection<String>
getSeeAlso()
String
getType()
boolean
isDeprecated()
void
setComment(String comment)
void
setDeprecated(Boolean deprecated)
void
setDeprecatedVersion(String deprecatedVersion)
void
setExample(String example)
Deprecated.void
setLicenseExceptionTemplate(String template)
Set the template text for the exceptionvoid
setLicenseExceptionText(String text)
Sets the text for the exceptionvoid
setName(String name)
void
setSeeAlso(Collection<String> seeAlso)
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
-
-
-
-
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 exceptiondocumentUri
- URI for the SPDX document containing the license exceptionid
- identifier for the license exceptioncopyManager
- if non-null, allows for copying of any properties set which use other model stores or document URI'screate
- 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
-
-
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 classorg.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 classModelObjectV2
- Parameters:
verifiedIds
- 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
-
toString
public String toString()
- Overrides:
toString
in classModelObjectV2
-
-