Package org.spdx.library.model
Class ExternalRef
java.lang.Object
org.spdx.library.model.ModelObject
org.spdx.library.model.ExternalRef
- All Implemented Interfaces:
Comparable<ExternalRef>
An External Reference allows a Package to reference an external source of
additional information, metadata, enumerations, asset identifiers, or downloadable content believed to
be relevant to the Package.
- Author:
- Gary O'Neall
-
Field Summary
Fields inherited from class org.spdx.library.model.ModelObject
strict -
Constructor Summary
ConstructorsConstructorDescriptionExternalRef(String id) ExternalRef(IModelStore modelStore, String documentUri, String id, ModelCopyManager copyManager, boolean create) -
Method Summary
Modifier and TypeMethodDescriptionImplementation of the specific verifications for this model objectintbooleanequivalent(ModelObject compare, boolean ignoreRelatedElements) getType()setComment(String comment) setReferenceCategory(ReferenceCategory referenceCategory) Set the reference categorysetReferenceLocator(String referenceLocator) Set the reference locatorsetReferenceType(ReferenceType referenceType) Set the reference typetoString()Methods 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, equivalent, 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
-
ExternalRef
- Throws:
InvalidSPDXAnalysisException
-
ExternalRef
- Parameters:
id-- Throws:
InvalidSPDXAnalysisException
-
ExternalRef
public ExternalRef(IModelStore modelStore, String documentUri, String id, @Nullable ModelCopyManager copyManager, boolean create) throws InvalidSPDXAnalysisException - Parameters:
modelStore-documentUri-id-create-copyManager-- Throws:
InvalidSPDXAnalysisException
-
-
Method Details
-
getType
- Specified by:
getTypein classModelObject- 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- 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:
- Any verification errors or warnings associated with this object
-
compareTo
- Specified by:
compareToin interfaceComparable<ExternalRef>
-
getComment
- Returns:
- the comment
- Throws:
InvalidSPDXAnalysisException
-
setComment
- Parameters:
comment- comment to set- Returns:
- this to build additional setters
- Throws:
InvalidSPDXAnalysisException
-
getReferenceCategory
- Returns:
- the referenceCategory
- Throws:
InvalidSPDXAnalysisException
-
setReferenceCategory
public ExternalRef setReferenceCategory(ReferenceCategory referenceCategory) throws InvalidSPDXAnalysisException Set the reference category- Parameters:
referenceCategory-- Returns:
- this to build additional setters
- Throws:
InvalidSPDXAnalysisException
-
getReferenceType
- Returns:
- the referenceType. If the refrenceType is not in the modelStore, the constant ReferenceType.MISSING is returned
- Throws:
InvalidSPDXAnalysisException
-
setReferenceType
public ExternalRef setReferenceType(ReferenceType referenceType) throws InvalidSPDXAnalysisException Set the reference type- Parameters:
referenceType-- Returns:
- this to build additional setters
- Throws:
InvalidSPDXAnalysisException
-
getReferenceLocator
- Returns:
- the referenceLocator. If not found, a blank string is returned
- Throws:
InvalidSPDXAnalysisException
-
setReferenceLocator
Set the reference locator- Parameters:
referenceLocator-- Returns:
- this to build additional setter
- 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
-
toString
- Overrides:
toStringin classModelObject
-