Class ExtractedLicenseInfo
- All Implemented Interfaces:
Comparable<AbstractExtractedLicenseInfo>
- Author:
- Gary O'Neall
-
Field Summary
Fields inherited from class org.spdx.library.model.ModelObject
strict -
Constructor Summary
ConstructorsConstructorDescriptionCreate a new ExtractedLicenseInfo objectCreate a new ExtractedLicenseInfo objectExtractedLicenseInfo(String id, String text) Create a new ExtractedLicenseInfo using the ID and textExtractedLicenseInfo(IModelStore modelStore, String documentUri, String id, ModelCopyManager copyManager, boolean create) Create a new ExtractedLicenseInfo object -
Method Summary
Modifier and TypeMethodDescriptionImplementation of the specific verifications for this model objectbooleanequivalent(ModelObject compare) booleanequivalent(ModelObject compare, boolean ignoreRelatedElements) getType()voidsetExtractedText(String text) Sets the license text.Methods inherited from class org.spdx.library.model.license.AbstractExtractedLicenseInfo
compareTo, toStringMethods inherited from class org.spdx.library.model.license.SimpleLicensingInfo
getComment, getLicenseId, getName, getSeeAlso, setComment, setName, setSeeAlsoMethods inherited from class org.spdx.library.model.ModelObject
addPropertyValueToCollection, addValueToCollection, clearValueCollection, clearValueCollection, clone, copyFrom, createAnnotation, createByteOffsetPointer, createChecksum, createConjunctiveLicenseSet, createCreationInfo, createCrossRef, createDisjunctiveLicenseSet, createExternalDocumentRef, createExternalRef, createExtractedLicense, createLineCharPointer, createPackage, createPackageVerificationCode, createRelationship, createSpdxFile, createSpdxSnippet, createStartEndPointer, enterCriticalSection, equals, getAnyLicenseInfoPropertyValue, getBooleanPropertyValue, getCopyManager, getDocumentUri, getElementPropertyValue, getEnumPropertyValue, getId, getIntegerPropertyValue, getModelStore, getObjectPropertyValue, getObjectPropertyValue, getObjectPropertyValueCollection, getObjectPropertyValueSet, getPropertyValueNames, getStringCollection, getStringPropertyValue, hashCode, idToIdType, isCollectionMembersAssignableTo, isStrict, leaveCriticalSection, removeProperty, removeProperty, removePropertyValueFromCollection, removePropertyValueFromCollection, replacePropertyValueCollection, setCopyManager, setPropertyValue, setPropertyValue, setStrict, toTypedValue, updateAddPropertyValueToCollection, updateClearValueCollection, updatePropertyValue, updateRemoveProperty, updateRemovePropertyValueFromCollection, verify, verify, verify, verifyCollection
-
Constructor Details
-
ExtractedLicenseInfo
Create a new ExtractedLicenseInfo objectUsers of the library should not call this constructor directly but use
SpdxDocument#createExtractedLicense. This ensures correct behaviour between that document and itsExtractedLicenseInfoinstance.Otherwise, the object may misbehave, such as with
SpdxDocument#addExtractedLicenseInfos.- Throws:
InvalidSPDXAnalysisException
-
ExtractedLicenseInfo
Create a new ExtractedLicenseInfo objectUsers of the library should not call this constructor directly but use
SpdxDocument#createExtractedLicense. This ensures correct behaviour between that document and itsExtractedLicenseInfoinstance.Otherwise, the object may misbehave, such as with
SpdxDocument#addExtractedLicenseInfos.- Parameters:
id- identifier for the license- Throws:
InvalidSPDXAnalysisException
-
ExtractedLicenseInfo
public ExtractedLicenseInfo(IModelStore modelStore, String documentUri, String id, @Nullable ModelCopyManager copyManager, boolean create) throws InvalidSPDXAnalysisException Create a new ExtractedLicenseInfo objectUsers of the library should prefer
SpdxDocument#createExtractedLicense.- 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:
InvalidSPDXAnalysisException
-
ExtractedLicenseInfo
Create a new ExtractedLicenseInfo using the ID and textUsers of the library should not call this constructor directly but use
SpdxDocument#createExtractedLicense. This ensures correct behaviour between that document and itsExtractedLicenseInfoinstance.Otherwise, the object may misbehave, such as with
SpdxDocument#addExtractedLicenseInfos.- Parameters:
id- identifier for the licensetext- text to associate with the license- Throws:
InvalidSPDXAnalysisException
-
-
Method Details
-
getType
- Specified by:
getTypein classModelObject- Returns:
- The class name for this object. Class names are defined in the constants file
-
getExtractedText
- Specified by:
getExtractedTextin classAbstractExtractedLicenseInfo- Returns:
- the text
- Throws:
SpdxInvalidTypeExceptionSpdxInvalidTypeExceptionInvalidSPDXAnalysisException
-
setExtractedText
Sets the license text.Affects both this object and the underlying store.
- Parameters:
text- text to associate with the license- Throws:
InvalidSPDXAnalysisException
-
_verify
Description copied from class:ModelObjectImplementation of the specific verifications for this model object- Specified by:
_verifyin classModelObject- 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:
-
equivalent
- Overrides:
equivalentin classModelObject- Returns:
- true if all the properties have the same or equivalent values
- Throws:
InvalidSPDXAnalysisException
-
equivalent
public boolean equivalent(ModelObject compare, boolean ignoreRelatedElements) throws InvalidSPDXAnalysisException - Overrides:
equivalentin classModelObjectignoreRelatedElements- if true, do not compare properties relatedSpdxElement - used to prevent infinite recursion- Returns:
- true if all the properties have the same or equivalent values
- Throws:
InvalidSPDXAnalysisException
-