Package org.spdx.rdfparser.model
Class ExternalDocumentRef
java.lang.Object
org.spdx.rdfparser.model.RdfModelObject
org.spdx.rdfparser.model.ExternalDocumentRef
- All Implemented Interfaces:
Cloneable,Comparable<ExternalDocumentRef>,IRdfModel
public class ExternalDocumentRef extends RdfModelObject implements Comparable<ExternalDocumentRef>
Information about an external SPDX document reference including the checksum.
This allows for verification of the external references.
Since an SPDX document must be in its own container, there are a few special
considerations for this class:
- model, node, and resource are associated with the document making an external reference,
it does not include the actual document being referenced
- This class can be used with only the URI for the external document being provided. It
does not require the entire document to be passed in. The spdxDocument itself is optional.
- Author:
- Gary O'Neall
-
Field Summary
Fields inherited from class org.spdx.rdfparser.model.RdfModelObject
model, modelContainer, node, refreshOnGet, resource -
Constructor Summary
Constructors Constructor Description ExternalDocumentRef(String spdxDocumentUri, Checksum checksum, String externalDocumentId)ExternalDocumentRef(IModelContainer modelContainer, org.apache.jena.graph.Node node)ExternalDocumentRef(SpdxDocument externalDocument, Checksum checksum, String externalDocumentId) -
Method Summary
Modifier and Type Method Description ExternalDocumentRefclone()intcompareTo(ExternalDocumentRef o)booleanequivalent(IRdfModel compare)Returns true if the compare object contains properties which would be equal if they were contained in the same RDF ModelChecksumgetChecksum()StringgetExternalDocumentId()a string containing letters, numbers, “.”, “-” or “+” which uniquely identifies an external document within this document.voidgetPropertiesFromModel()Fetch all of the properties from the model and populate the local Java propertiesSpdxDocumentgetSpdxDocument()StringgetSpdxDocumentNamespace()org.apache.jena.rdf.model.ResourcegetType(org.apache.jena.rdf.model.Model model)StringgetUri(IModelContainer modelContainer)Get the URI for this RDF object.voidpopulateModel()Populate the RDF model from the Java propertiesvoidsetChecksum(Checksum checksum)voidsetExternalDocumentId(String externalDocumentId)voidsetSpdxDocument(SpdxDocument spdxDocument)voidsetSpdxDocumentNamespace(String spdxDocumentNamespace)List<String>verify()Methods inherited from class org.spdx.rdfparser.model.RdfModelObject
addPropertyUriValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, addPropertyValue, arraysEquivalent, createResource, createResource, equals, equivalentConsideringNull, findAnnotationPropertyValues, findAnyLicenseInfoPropertyValue, findAnyLicenseInfoPropertyValues, findChecksumPropertyValue, findCreationInfoPropertyValue, findDuplicateResource, findElementPropertyValue, findExternalDocRefPropertyValues, findExternalDocRefPropertyValues, findExternalRefPropertyValues, findIntPropertyValue, findMultipleChecksumPropertyValues, findMultipleCrossRefPropertyValues, findMultipleDoapPropertyValues, findMultipleElementPropertyValues, findMultiplePropertyValues, findReferenceTypePropertyValue, findRelationshipPropertyValues, findReviewPropertyValues, findSinglePointerPropertyValue, findSinglePropertyValue, findStartEndPointerPropertyValues, findUriPropertyValue, findUriPropertyValues, findVerificationCodePropertyValue, getNode, hashCode, isRefreshOnGet, removePropertyValue, resourcesEqual, setMultipleObjectsForSameNode, setPropertyUriValue, setPropertyUriValues, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, setPropertyValue, SetPropertyValue, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setSingleObjectForSameNode
-
Constructor Details
-
ExternalDocumentRef
public ExternalDocumentRef(IModelContainer modelContainer, org.apache.jena.graph.Node node) throws InvalidSPDXAnalysisException- Parameters:
modelContainer-node-- Throws:
InvalidSPDXAnalysisException
-
ExternalDocumentRef
- Parameters:
spdxDocumentUri- Unique URI for the external SPDX documentchecksum- Sha1 checksum for the external document
-
ExternalDocumentRef
public ExternalDocumentRef(SpdxDocument externalDocument, Checksum checksum, String externalDocumentId)- Parameters:
externalDocument- SPDX Document being referencedchecksum- Sha1 checksum of the external document
-
-
Method Details
-
getPropertiesFromModel
Description copied from class:RdfModelObjectFetch all of the properties from the model and populate the local Java properties- Specified by:
getPropertiesFromModelin classRdfModelObject- Throws:
InvalidSPDXAnalysisException
-
verify
-
getUri
Description copied from class:RdfModelObjectGet the URI for this RDF object. Null if this is for an anonomous node.- Specified by:
getUriin classRdfModelObject- Returns:
-
getType
public org.apache.jena.rdf.model.Resource getType(org.apache.jena.rdf.model.Model model)- Specified by:
getTypein classRdfModelObject- Returns:
- the RDF class name for the object
-
populateModel
Description copied from class:RdfModelObjectPopulate the RDF model from the Java properties- Specified by:
populateModelin classRdfModelObject- Throws:
InvalidSPDXAnalysisException
-
getChecksum
- Returns:
- the checksum
- Throws:
InvalidSPDXAnalysisException
-
setChecksum
- Parameters:
checksum- the checksum to set- Throws:
InvalidSPDXAnalysisException
-
getSpdxDocumentNamespace
- Returns:
- the spdxDocumentNamespace
-
setSpdxDocumentNamespace
public void setSpdxDocumentNamespace(String spdxDocumentNamespace) throws InvalidSPDXAnalysisException- Parameters:
spdxDocumentNamespace- the spdxDocumentNamespace to set- Throws:
InvalidSPDXAnalysisException
-
getSpdxDocument
- Returns:
- the spdxDocument
-
setSpdxDocument
- Parameters:
spdxDocument- the spdxDocument to set- Throws:
InvalidSPDXAnalysisException
-
equivalent
Description copied from interface:IRdfModelReturns true if the compare object contains properties which would be equal if they were contained in the same RDF Model- Specified by:
equivalentin interfaceIRdfModel- Returns:
-
clone
-
getExternalDocumentId
a string containing letters, numbers, “.”, “-” or “+” which uniquely identifies an external document within this document.- Returns:
-
setExternalDocumentId
- Parameters:
externalDocumentId-
-
compareTo
- Specified by:
compareToin interfaceComparable<ExternalDocumentRef>
-