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>
public class ExternalRef extends ModelObject implements 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
-
Constructor Summary
Constructors Constructor Description ExternalRef()ExternalRef(String id)ExternalRef(IModelStore modelStore, String documentUri, String id, ModelCopyManager copyManager, boolean create) -
Method Summary
Modifier and Type Method Description protected List<String>_verify(Set<String> verifiedIds, String specVersion)Implementation of the specific verifications for this model objectintcompareTo(ExternalRef o)booleanequivalent(ModelObject compare, boolean ignoreRelatedElements)Optional<String>getComment()ReferenceCategorygetReferenceCategory()StringgetReferenceLocator()ReferenceTypegetReferenceType()StringgetType()ExternalRefsetComment(String comment)ExternalRefsetReferenceCategory(ReferenceCategory referenceCategory)Set the reference categoryExternalRefsetReferenceLocator(String referenceLocator)Set the reference locatorExternalRefsetReferenceType(ReferenceType referenceType)Set the reference typeStringtoString()Methods 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, 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 InvalidSPDXAnalysisExceptionSet 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 InvalidSPDXAnalysisExceptionSet 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
public ExternalRef setReferenceLocator(String referenceLocator) throws InvalidSPDXAnalysisExceptionSet 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
-