Package org.spdx.library.model.v2
Class ExternalRef
- java.lang.Object
-
- org.spdx.core.CoreModelObject
-
- org.spdx.library.model.v2.ModelObjectV2
-
- org.spdx.library.model.v2.ExternalRef
-
- All Implemented Interfaces:
Comparable<ExternalRef>
public class ExternalRef extends ModelObjectV2 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
-
Fields inherited from class org.spdx.library.model.v2.ModelObjectV2
LATEST_SPDX_2_VERSION
-
-
Constructor Summary
Constructors Constructor Description ExternalRef()
ExternalRef(String id)
ExternalRef(org.spdx.storage.IModelStore modelStore, String documentUri, String id, org.spdx.core.IModelCopyManager copyManager, boolean create)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<String>
_verify(Set<String> verifiedIds, String specVersion)
Implementation of the specific verifications for this model objectint
compareTo(ExternalRef o)
boolean
equivalent(org.spdx.core.CoreModelObject compare, boolean ignoreRelatedElements)
Optional<String>
getComment()
ReferenceCategory
getReferenceCategory()
String
getReferenceLocator()
ReferenceType
getReferenceType()
String
getType()
ExternalRef
setComment(String comment)
ExternalRef
setReferenceCategory(ReferenceCategory referenceCategory)
Set the reference categoryExternalRef
setReferenceLocator(String referenceLocator)
Set the reference locatorExternalRef
setReferenceType(ReferenceType referenceType)
Set the reference typeString
toString()
-
Methods inherited from class org.spdx.library.model.v2.ModelObjectV2
_verify, createAnnotation, createByteOffsetPointer, createChecksum, createConjunctiveLicenseSet, createCreationInfo, createCrossRef, createDisjunctiveLicenseSet, createExternalDocumentRef, createExternalRef, createExtractedLicense, createLineCharPointer, createPackage, createPackageVerificationCode, createRelationship, createSpdxFile, createSpdxSnippet, createStartEndPointer, equals, getAnyLicenseInfoPropertyValue, getDocumentUri, getElementPropertyValue, getId, hashCode, isEquivalentToNull, isNoAssertion, isRelatedElement, toTypedValue, verify
-
Methods inherited from class org.spdx.core.CoreModelObject
addPropertyValueToCollection, clearValueCollection, clone, copyFrom, enterCriticalSection, equivalent, getBooleanPropertyValue, getCopyManager, getDoublePropertyValue, getEnumPropertyValue, getIdPrefix, getIntegerPropertyValue, getModelStore, getObjectPropertyValue, getObjectPropertyValue, getObjectPropertyValueCollection, getObjectPropertyValueSet, getObjectUri, getPropertyValueDescriptors, getSpecVersion, getStringCollection, getStringPropertyValue, isCollectionMembersAssignableTo, isExternal, isStrict, leaveCriticalSection, removeProperty, removePropertyValueFromCollection, setCopyManager, setIdPrefix, setPropertyValue, setStrict, updateAddPropertyValueToCollection, updateClearValueCollection, updatePropertyValue, updateRemoveProperty, updateRemovePropertyValueFromCollection, verify, verify, verifyCollection
-
-
-
-
Constructor Detail
-
ExternalRef
public ExternalRef() throws org.spdx.core.InvalidSPDXAnalysisException
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
ExternalRef
public ExternalRef(String id) throws org.spdx.core.InvalidSPDXAnalysisException
- Parameters:
id
- identifier- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
ExternalRef
public ExternalRef(org.spdx.storage.IModelStore modelStore, String documentUri, String id, @Nullable org.spdx.core.IModelCopyManager copyManager, boolean create) throws org.spdx.core.InvalidSPDXAnalysisException
- Parameters:
modelStore
- container which includes the model datadocumentUri
- URI for the SPDX document containing the model dataid
- identifiercopyManager
- 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:
org.spdx.core.InvalidSPDXAnalysisException
-
-
Method Detail
-
getType
public String getType()
- Specified by:
getType
in classorg.spdx.core.CoreModelObject
-
_verify
protected List<String> _verify(Set<String> verifiedIds, String specVersion)
Description copied from class:ModelObjectV2
Implementation of the specific verifications for this model object- Specified by:
_verify
in classModelObjectV2
- 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
public int compareTo(ExternalRef o)
- Specified by:
compareTo
in interfaceComparable<ExternalRef>
-
getComment
public Optional<String> getComment() throws org.spdx.core.InvalidSPDXAnalysisException
- Returns:
- the comment
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
setComment
public ExternalRef setComment(String comment) throws org.spdx.core.InvalidSPDXAnalysisException
- Parameters:
comment
- comment to set- Returns:
- this to build additional setters
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
getReferenceCategory
public ReferenceCategory getReferenceCategory() throws org.spdx.core.InvalidSPDXAnalysisException
- Returns:
- the referenceCategory
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
setReferenceCategory
public ExternalRef setReferenceCategory(ReferenceCategory referenceCategory) throws org.spdx.core.InvalidSPDXAnalysisException
Set the reference category- Parameters:
referenceCategory
-- Returns:
- this to build additional setters
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
getReferenceType
public ReferenceType getReferenceType() throws org.spdx.core.InvalidSPDXAnalysisException
- Returns:
- the referenceType. If the referenceType is not in the modelStore, the constant ReferenceType.MISSING is returned
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
setReferenceType
public ExternalRef setReferenceType(ReferenceType referenceType) throws org.spdx.core.InvalidSPDXAnalysisException
Set the reference type- Parameters:
referenceType
-- Returns:
- this to build additional setters
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
getReferenceLocator
public String getReferenceLocator() throws org.spdx.core.InvalidSPDXAnalysisException
- Returns:
- the referenceLocator. If not found, a blank string is returned
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
setReferenceLocator
public ExternalRef setReferenceLocator(String referenceLocator) throws org.spdx.core.InvalidSPDXAnalysisException
Set the reference locator- Parameters:
referenceLocator
-- Returns:
- this to build additional setter
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
equivalent
public boolean equivalent(org.spdx.core.CoreModelObject compare, boolean ignoreRelatedElements) throws org.spdx.core.InvalidSPDXAnalysisException
- Overrides:
equivalent
in classorg.spdx.core.CoreModelObject
- Throws:
org.spdx.core.InvalidSPDXAnalysisException
-
toString
public String toString()
- Overrides:
toString
in classModelObjectV2
-
-