Package org.spdx.library.model.license
Class ExtractedLicenseInfo
java.lang.Object
org.spdx.library.model.ModelObject
org.spdx.library.model.license.AnyLicenseInfo
org.spdx.library.model.license.SimpleLicensingInfo
org.spdx.library.model.license.AbstractExtractedLicenseInfo
org.spdx.library.model.license.ExtractedLicenseInfo
- All Implemented Interfaces:
Comparable<AbstractExtractedLicenseInfo>
public class ExtractedLicenseInfo extends AbstractExtractedLicenseInfo
An ExtractedLicensingInfo represents a license or licensing notice that was found in the package.
Any license text that is recognized as a license may be represented as a License
rather than an ExtractedLicensingInfo.
- Author:
- Gary O'Neall
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ExtractedLicenseInfo()ExtractedLicenseInfo(String id)ExtractedLicenseInfo(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 Type Method Description protected List<String>_verify(Set<String> verifiedIds, String specVersion)Implementation of the specific verifications for this model objectbooleanequivalent(ModelObject compare)booleanequivalent(ModelObject compare, boolean ignoreRelatedElements)StringgetExtractedText()StringgetType()voidsetExtractedText(String 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, 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
- Throws:
InvalidSPDXAnalysisException
-
ExtractedLicenseInfo
- Throws:
InvalidSPDXAnalysisException
-
ExtractedLicenseInfo
public ExtractedLicenseInfo(IModelStore modelStore, String documentUri, String id, @Nullable ModelCopyManager copyManager, boolean create) throws InvalidSPDXAnalysisExceptionCreate a new ExtractedLicenseInfo 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:
InvalidSPDXAnalysisException
-
ExtractedLicenseInfo
Create a new ExtractedLicenseInfo using the ID and text- Parameters:
id-text-- 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
- Parameters:
text- the text to set- 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
-