Package org.spdx.library.model.license
Class ExternalExtractedLicenseInfo
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
org.spdx.library.model.license.ExternalExtractedLicenseInfo
- All Implemented Interfaces:
Comparable<ExtractedLicenseInfo>,IndividualUriValue
public class ExternalExtractedLicenseInfo extends ExtractedLicenseInfo implements IndividualUriValue
- Author:
- Gary O'Neall
This class represents an ExtractedLicenseInfo which is stored in an external SPDX document.
The ID must be in the form
SpdxConstants.EXTERNAL_LICENSE_REF_PATTERN.pattern()
-
Field Summary
-
Constructor Summary
Constructors Constructor Description ExternalExtractedLicenseInfo(String id)ExternalExtractedLicenseInfo(IModelStore modelStore, String documentUri, String id, ModelCopyManager copyManager, boolean create) -
Method Summary
Methods inherited from class org.spdx.library.model.license.ExtractedLicenseInfo
compareTo, equivalent, toStringMethods inherited from class org.spdx.library.model.license.SimpleLicensingInfo
getCrossRef, getLicenseIdMethods 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
-
ExternalExtractedLicenseInfo
- Throws:
InvalidSPDXAnalysisException
-
ExternalExtractedLicenseInfo
public ExternalExtractedLicenseInfo(IModelStore modelStore, String documentUri, String id, @Nullable ModelCopyManager copyManager, boolean create) throws InvalidSPDXAnalysisException- Parameters:
modelStore-documentUri-id-copyManager-create-- Throws:
InvalidSPDXAnalysisException
-
-
Method Details
-
getExternalDocumentId
- Returns:
- external document ID for the external reference
- Throws:
InvalidSPDXAnalysisException
-
getExternalLicenseRef
- Returns:
- element ID used in the external document
- Throws:
InvalidSPDXAnalysisException
-
getType
- Overrides:
getTypein classExtractedLicenseInfo- Returns:
- The class name for this object. Class names are defined in the constants file
-
_verify
Description copied from class:ModelObjectImplementation of the specific verifications for this model object- Overrides:
_verifyin classExtractedLicenseInfo- Parameters:
verifiedIds- list of all Element Id's which have already been verified - prevents infinite recursion- Returns:
- Any verification errors or warnings associated with this object
-
getExternalExtractedLicenseURI
- Returns:
- the URI associated with this external SPDX Extracted License
- Throws:
InvalidSPDXAnalysisException
-
externalExtractedLicenseIdToURI
public static String externalExtractedLicenseIdToURI(String externalExtractedLicenseId, IModelStore stModelStore, String stDocumentUri, ModelCopyManager copyManager) throws InvalidSPDXAnalysisException- Parameters:
externalExtractedLicenseId-stModelStore-stDocumentUri-copyManager-- Returns:
- The URI associated with the external LicenseRef with the ID externalLicenseRefId
- Throws:
InvalidSPDXAnalysisException
-
uriToExternalExtractedLicense
public static ExternalExtractedLicenseInfo uriToExternalExtractedLicense(String externalLicenseUri, IModelStore stModelStore, String stDocumentUri, ModelCopyManager copyManager) throws InvalidSPDXAnalysisException- Parameters:
uri- URI of the form externaldocumentnamespace#LicenseRef-XXXXXstModelStore-stDocumentUri-copyManager- if non-null, create the external doc ref if it is not already in the ModelStore- Returns:
- ExternalSpdxRef an ExternalLicenseRef based on a URI of the form externaldocumentnamespace#LicenseRef-XXXXX
- Throws:
InvalidSPDXAnalysisException
-
uriToExternalExtractedLicenseId
public static String uriToExternalExtractedLicenseId(String uri, IModelStore stModelStore, String stDocumentUri, ModelCopyManager copyManager) throws InvalidSPDXAnalysisExceptionConvert a URI to an ID for an External Extracted License- Parameters:
uri- URI with the external document namespace and the external Extracted License in the form namespace#LicenseRef-XXXXstModelStore-stDocumentUri-copyManager- if non-null, create the external doc ref if it is not already in the ModelStore- Returns:
- external SPDX element ID in the form DocumentRef-XX:LicenseRef-XXXX
- Throws:
InvalidSPDXAnalysisException
-
equivalent
- Overrides:
equivalentin classExtractedLicenseInfo- Returns:
- true if all the properties have the same or equivalent values
-
getIndividualURI
- Specified by:
getIndividualURIin interfaceIndividualUriValue- Returns:
- a unique identifier for this value. Typically the namespace + the long name
-
getExtractedText
- Overrides:
getExtractedTextin classExtractedLicenseInfo- Returns:
- the text
- Throws:
SpdxInvalidTypeExceptionInvalidSPDXAnalysisException
-
setExtractedText
- Overrides:
setExtractedTextin classExtractedLicenseInfo- Parameters:
text- the text to set- Throws:
InvalidSPDXAnalysisException
-
getComment
- Overrides:
getCommentin classSimpleLicensingInfo- Returns:
- the comments
- Throws:
SpdxInvalidTypeExceptionInvalidSPDXAnalysisException
-
setComment
- Overrides:
setCommentin classSimpleLicensingInfo- Parameters:
comment- the comment to set- Throws:
InvalidSPDXAnalysisException
-
getSeeAlso
- Overrides:
getSeeAlsoin classSimpleLicensingInfo- Returns:
- the urls which reference the same license information
- Throws:
SpdxInvalidTypeExceptionInvalidSPDXAnalysisException
-
setSeeAlso
- Overrides:
setSeeAlsoin classSimpleLicensingInfo- Parameters:
seeAlsoUrl- the urls which are references to the same license to set- Throws:
InvalidSPDXAnalysisException
-
getName
- Overrides:
getNamein classSimpleLicensingInfo- Returns:
- the name
- Throws:
SpdxInvalidTypeExceptionInvalidSPDXAnalysisException
-
setName
- Overrides:
setNamein classSimpleLicensingInfo- Parameters:
name- the name to set- Throws:
InvalidSPDXAnalysisException
-