Package org.spdx.rdfparser.model
Class ExternalRef
java.lang.Object
org.spdx.rdfparser.model.RdfModelObject
org.spdx.rdfparser.model.ExternalRef
- All Implemented Interfaces:
Cloneable,Comparable<ExternalRef>,IRdfModel
public class ExternalRef extends RdfModelObject 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
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classExternalRef.ReferenceCategory -
Field Summary
Fields inherited from class org.spdx.rdfparser.model.RdfModelObject
model, modelContainer, node, refreshOnGet, resource -
Constructor Summary
Constructors Constructor Description ExternalRef(IModelContainer modelContainer, org.apache.jena.graph.Node node)ExternalRef(ExternalRef.ReferenceCategory referenceCategory, ReferenceType referenceType, String referenceLocator, String comment) -
Method Summary
Modifier and Type Method Description ExternalRefclone()intcompareTo(ExternalRef o)booleanequivalent(IRdfModel compare)Returns true if the compare object contains properties which would be equal if they were contained in the same RDF Modelorg.apache.jena.rdf.model.ResourcefindDuplicateResource(IModelContainer modelContainer, String uri)Search the model to see if there is a duplicate resource either based on the URI or based on other information.StringgetComment()voidgetPropertiesFromModel()Fetch all of the properties from the model and populate the local Java propertiesExternalRef.ReferenceCategorygetReferenceCategory()StringgetReferenceLocator()ReferenceTypegetReferenceType()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 propertiesvoidsetComment(String comment)voidsetReferenceCategory(ExternalRef.ReferenceCategory referenceCategory)voidsetReferenceLocator(String referenceLocator)voidsetReferenceType(ReferenceType referenceType)StringtoString()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, findElementPropertyValue, findExternalDocRefPropertyValues, findExternalDocRefPropertyValues, findExternalRefPropertyValues, findIntPropertyValue, findMultipleChecksumPropertyValues, 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, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setPropertyValues, setSingleObjectForSameNode
-
Constructor Details
-
ExternalRef
public ExternalRef(ExternalRef.ReferenceCategory referenceCategory, ReferenceType referenceType, String referenceLocator, String comment)- Parameters:
referenceCategory- Category for the external referencereferenceType- Reference type as defined in the SPDX appendixreferenceLocator- unique string with no spaces necessary to access the packagespecific information, metadata, or content within the target location. The format of the locator is subject to constraints defined by the referenceType
-
ExternalRef
public ExternalRef(IModelContainer modelContainer, org.apache.jena.graph.Node node) throws InvalidSPDXAnalysisException- Parameters:
modelContainer- Container for the RDF modelnode- Node for this external references- Throws:
InvalidSPDXAnalysisException
-
-
Method Details
-
verify
-
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:
-
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
-
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:
- Throws:
InvalidSPDXAnalysisException
-
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
-
compareTo
- Specified by:
compareToin interfaceComparable<ExternalRef>
-
clone
-
getComment
- Returns:
- the comment
-
setComment
-
getReferenceCategory
- Returns:
- the referenceCategory
-
setReferenceCategory
public void setReferenceCategory(ExternalRef.ReferenceCategory referenceCategory) throws InvalidSPDXAnalysisException- Parameters:
referenceCategory- the referenceCategory to set- Throws:
InvalidSPDXAnalysisException
-
getReferenceType
- Returns:
- the referenceType
- Throws:
InvalidSPDXAnalysisException
-
setReferenceType
- Parameters:
referenceType- the referenceType to set- Throws:
InvalidSPDXAnalysisException
-
getReferenceLocator
- Returns:
- the referenceLocator
-
setReferenceLocator
- Parameters:
referenceLocator- the referenceLocator to set
-
findDuplicateResource
public org.apache.jena.rdf.model.Resource findDuplicateResource(IModelContainer modelContainer, String uri) throws InvalidSPDXAnalysisExceptionDescription copied from class:RdfModelObjectSearch the model to see if there is a duplicate resource either based on the URI or based on other information. Subclasses may choose to override this method to prevent duplicate resource from being created with the same properties.- Overrides:
findDuplicateResourcein classRdfModelObject- Returns:
- Any duplicate resource found. Null if no duplicate resource was found.
- Throws:
InvalidSPDXAnalysisException
-
toString
-