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.ExtractedLicenseInfo
- All Implemented Interfaces:
Comparable<ExtractedLicenseInfo>
- Direct Known Subclasses:
ExternalExtractedLicenseInfo
public class ExtractedLicenseInfo extends SimpleLicensingInfo implements Comparable<ExtractedLicenseInfo>
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 SimpleLicensingInfo object -
Method Summary
Modifier and Type Method Description protected List<String>_verify(List<String> verifiedIds)Implementation of the specific verifications for this model objectintcompareTo(ExtractedLicenseInfo o)booleanequivalent(ModelObject compare)booleanequivalent(ModelObject compare, boolean ignoreRelatedElements)StringgetExtractedText()StringgetType()voidsetExtractedText(String text)StringtoString()Methods inherited from class org.spdx.library.model.license.SimpleLicensingInfo
getComment, getCrossRef, 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, 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 SimpleLicensingInfo 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
-
toString
- Specified by:
toStringin classAnyLicenseInfo
-
getExtractedText
- Returns:
- the text
- Throws:
SpdxInvalidTypeExceptionInvalidSPDXAnalysisException
-
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 recursion- Returns:
-
compareTo
- Specified by:
compareToin interfaceComparable<ExtractedLicenseInfo>
-
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
-